Skip to content

Commit 63f0fd6

Browse files
authored
Update update-readme.yml
1 parent fae8eaa commit 63f0fd6

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

.github/workflows/update-readme.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,31 @@ on:
55
branches:
66
- main
77

8+
permissions:
9+
contents: write
10+
811
jobs:
912
update-readme:
1013
runs-on: ubuntu-latest
14+
1115
steps:
1216
- name: Checkout repository
13-
uses: actions/checkout@v3
17+
uses: actions/checkout@v4
1418

1519
- name: Get new README content from URL
1620
run: |
17-
curl -H "Authorization: Bearer ${{ secrets.README_URL_TOKEN }}" -o README.md ${{ secrets.README_URL }}
18-
21+
curl -H "Authorization: Bearer ${{ secrets.README_URL_TOKEN }}" -L -o README.md "${{ secrets.README_URL }}"
22+
1923
- name: Commit and push updated README
2024
run: |
2125
git config --global user.name "github-actions"
2226
git config --global user.email "github-actions@github.com"
2327
git add README.md
28+
29+
if git diff --cached --quiet; then
30+
echo "No changes to commit"
31+
exit 0
32+
fi
33+
2434
git commit -m "Update README programmatically"
2535
git push

0 commit comments

Comments
 (0)