Skip to content

Commit 3cc5a33

Browse files
authored
Update update-requirements.yml
1 parent 8a2cefb commit 3cc5a33

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

.github/workflows/update-requirements.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ on:
99
jobs:
1010
update-requirements:
1111
runs-on: ubuntu-latest
12+
13+
# --- THIS IS THE FIX ---
14+
# Grant the job the necessary permissions to push code.
15+
permissions:
16+
contents: write
17+
1218
steps:
1319
- uses: actions/checkout@v4
1420

@@ -23,10 +29,11 @@ jobs:
2329
- name: Compile requirements
2430
run: pip-compile pyproject.toml -o requirements.txt --resolver=backtracking
2531

26-
- name: Commit changes
32+
- name: Commit and push changes
2733
run: |
2834
git config --local user.email "action@github.com"
2935
git config --local user.name "GitHub Action"
3036
git add requirements.txt
37+
# This command only commits if there's an actual change
3138
git diff --staged --quiet || git commit -m "chore: Update requirements.txt"
3239
git push

0 commit comments

Comments
 (0)