Create Pull Request for Badge Updates #5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Create Pull Request for Badge Updates | |
| on: | |
| workflow_run: | |
| workflows: ["Check and Update Badges"] | |
| types: | |
| - completed | |
| jobs: | |
| create-pr: | |
| runs-on: ubuntu-22.04 | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| with: | |
| ref: gh-pages | |
| - name: Fetch all branches | |
| run: | | |
| git fetch --all | |
| - name: Create Pull Request | |
| env: | |
| BRANCH_NAME: update-badges-${{ github.run_id }} | |
| run: | | |
| if git rev-parse --verify origin/$BRANCH_NAME; then | |
| echo "::notice::Branch $BRANCH_NAME exists, creating PR." | |
| else | |
| echo "::error::Branch $BRANCH_NAME not found." | |
| exit 1 | |
| fi | |
| - name: Create Pull Request | |
| uses: peter-evans/create-pull-request@v5 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| base: gh-pages | |
| branch: ${{ env.BRANCH_NAME }} | |
| title: "Update badges.json" | |
| body: | | |
| This pull request updates `badges.json` with the latest release URLs. | |
| Please review and merge if everything looks correct. | |
| labels: "automated update" | |
| assignees: "Garlicrot" |