Skip to content

Commit c2facec

Browse files
Add PR-generating capabilities to the bump-dev-dep workflow (#1396)
Followup to #1394
1 parent 47045b4 commit c2facec

1 file changed

Lines changed: 24 additions & 1 deletion

File tree

.github/workflows/bump-dev-dep.yml

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ on:
1313
- black
1414
- urllib
1515
jobs:
16-
regen:
16+
bump-dev-dep:
17+
permissions:
18+
contents: read # Required to checkout
1719
runs-on: ubuntu-latest
1820
steps:
1921
- name: Checkout code
@@ -32,3 +34,24 @@ jobs:
3234
run: uv run -P $PKG_TO_BUMP prek -a uv-export
3335
env:
3436
PKG_TO_BUMP: ${{ inputs.package }}
37+
38+
- name: Check for changes
39+
run: |
40+
if [[ -n $(git status --porcelain) ]]; then
41+
echo "Changes detected. Committing and pushing..."
42+
git add uv.lock requirements.txt docs/requirements.txt
43+
git commit -m "Bump $PKG_TO_BUMP dependency"
44+
git push
45+
else
46+
echo "No changes detected. Nothing to commit."
47+
fi
48+
env:
49+
PKG_TO_BUMP: ${{ inputs.package }}
50+
51+
- name: Create Pull Request
52+
uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8.1.0
53+
with:
54+
token: ${{ secrets.GITHUB_TOKEN }}
55+
commit-message: "Bump ${{ inputs.package }} dependency"
56+
title: "Bump ${{ inputs.package }} development dependency"
57+
body: "This PR was automatically generated by the bump-dev-dep workflow."

0 commit comments

Comments
 (0)