Skip to content

Commit 36fc88d

Browse files
committed
Update GitHub Actions workflow to conditionally commit and push changes to README.md
1 parent 09da2f8 commit 36fc88d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

.github/workflows/update_readme.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,13 @@ jobs:
2727
- name: Run update script
2828
run: python automata.py
2929

30-
- name: Commit and push changes
30+
- name: Commit and push if changed
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3133
run: |
3234
git config --global user.name "GitHub Action Bot"
3335
git config --global user.email "github-actions[bot]@users.noreply.github.com"
3436
git add README.md
3537
git diff --staged --quiet || git commit -m "Auto-update README.md"
36-
git push
38+
git push https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }}.git main
39+

0 commit comments

Comments
 (0)