Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions .github/workflows/update-readme.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,33 @@ jobs:
template: "templates/README.md.tpl"
writeTo: "profile/README.md"

- uses: stefanzweifel/git-auto-commit-action@v7.1.0
- name: Commit changes
id: auto-commit
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
uses: stefanzweifel/git-auto-commit-action@v7.1.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
branch: main
commit_message: "chore: Update generated README"
commit_user_name: "GitHub Actions Bot"
commit_user_email: "actions@github.com"
commit_author: "GitHub Actions Bot <actions@github.com>"
commit_author: "GitHub Actions Bot <actions@github.com>"
skip_push: true

- name: Push changes with retry
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request' && steps.auto-commit.outputs.changes_detected == 'true'
run: |
max_retries=3
for attempt in $(seq 1 $max_retries); do
echo "Push attempt $attempt of $max_retries"
if git push origin main; then
echo "Push succeeded on attempt $attempt"
exit 0
fi
echo "Push failed, pulling with rebase and retrying..."
git pull --rebase origin main
sleep $((attempt * 2))
done
echo "Push failed after $max_retries attempts"
exit 1