Update README with Plugins List #3
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: Update README After Badge Changes | |
| on: | |
| workflow_dispatch: # Allows manual trigger only | |
| jobs: | |
| update-readme: | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| - name: Fetch badges.json from gh-pages branch | |
| run: | | |
| git fetch origin gh-pages:gh-pages-temp | |
| git checkout gh-pages-temp -- badges.json | |
| echo "::notice::badges.json fetched from gh-pages branch." | |
| - name: Switch back to main branch | |
| run: | | |
| git checkout main | |
| echo "::notice::Switched back to main branch." | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: '18' | |
| - name: Install dependencies | |
| run: npm install axios | |
| - name: Update README download URLs | |
| id: update-readme | |
| run: | | |
| node update-readme.js | |
| echo "::notice::README updated with latest download URLs." | |
| - name: Commit changes and create a new branch | |
| run: | | |
| git config --local user.name "GitHub Actions Bot" | |
| git config --local user.email "[email protected]" | |
| BRANCH_NAME="update-readme-${{ github.run_id }}" | |
| echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV | |
| echo "$BRANCH_NAME" > branch-name.txt | |
| git checkout -b $BRANCH_NAME | |
| git add README.md | |
| git commit -m "Update README with latest download URLs" | |
| git push origin HEAD | |
| echo "::notice::Changes committed and branch pushed." | |
| - name: Upload branch name artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: branch-name | |
| path: branch-name.txt | |
| create-pr: | |
| runs-on: ubuntu-22.04 | |
| needs: update-readme | |
| steps: | |
| - name: Download branch name artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: branch-name | |
| - name: Load branch name | |
| run: | | |
| BRANCH_NAME=$(cat branch-name.txt) | |
| echo "Loaded branch name: $BRANCH_NAME" | |
| echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV | |
| - name: Create an issue notification | |
| uses: peter-evans/create-issue-from-file@v4 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| title: "PR Needed: Update README" | |
| content: | | |
| A new branch has been created: **${{ env.BRANCH_NAME }}**. | |
| Please review the changes and open a pull request from this branch. | |
| **Compare Changes:** [View on GitHub](https://github.com/RusherDevelopment/rusherhack-plugins/compare/gh-pages...${{ env.BRANCH_NAME }}) | |
| labels: "automated notification" |