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
54 changes: 17 additions & 37 deletions .github/workflows/update-readme-contributors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ on:
jobs:
update-contributors:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write

steps:
- name: Checkout the repo
Expand Down Expand Up @@ -105,41 +108,18 @@ jobs:
}
result-encoding: string

- name: Commit and push changes if README was updated
- name: Create Pull Request if README was updated
if: steps.update-readme.outputs.result == 'true'
shell: pwsh
run: |
# Check if there are changes to commit
$gitStatus = git status --porcelain
if ([string]::IsNullOrWhiteSpace($gitStatus)) {
Write-Output "No changes to commit. README is already up to date."
exit 0
}

# Configure git
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"

# Add, commit and push changes
git add ReadMe.md
git commit -m "docs: update contributors in README [skip ci]"

# Push changes - retry up to 3 times in case of network issues
$maxRetries = 3
$retryCount = 0

while ($retryCount -lt $maxRetries) {
try {
git push
Write-Output "Successfully pushed changes to the repository."
exit 0
}
catch {
$retryCount++
Write-Output "Push failed. Retrying in 5 seconds... (Attempt $retryCount of $maxRetries)"
Start-Sleep -Seconds 5
}
}

Write-Output "Failed to push changes after $maxRetries attempts."
exit 1
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "docs: update contributors in README [skip ci]"
title: "docs: Update contributors in README"
body: |
This PR updates the README.md file with the latest contributors to the project.

*This is an automated PR created by the update-readme-contributors workflow.*
branch: auto-update-readme-contributors
branch-suffix: timestamp
delete-branch: true
base: main