Update README with Plugins List #19
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: # Manual trigger only for now | |
| jobs: | |
| check-and-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 | |
| git show origin/gh-pages:badges.json > badges.json | |
| echo "::notice::Fetched badges.json from gh-pages branch." | |
| - name: Parse badges.json and save artifact | |
| run: | | |
| node parse-badges.js | |
| echo "::notice::Parsed badges.json and saved artifact." | |
| - name: Clean up badges.json | |
| run: | | |
| rm -f badges.json | |
| echo "::notice::Removed badges.json after parsing." | |
| - name: Upload parsed badges artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: parsed-badges | |
| path: parsed-badges.json | |
| - name: Download parsed badges artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: parsed-badges | |
| - name: Update README if changes are found | |
| id: update-readme | |
| run: | | |
| node update-readme.js parsed-badges.json | |
| if [ $? -eq 0 ]; then | |
| echo "changes-found=true" >> $GITHUB_ENV | |
| echo "changes-found=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "changes-found=false" >> $GITHUB_ENV | |
| echo "changes-found=false" >> $GITHUB_OUTPUT | |
| fi | |
| echo "::notice::Checked and updated README if changes were found." | |
| outputs: | |
| changes-found: ${{ steps.update-readme.outputs.changes-found }} | |
| create-pr: | |
| runs-on: ubuntu-22.04 | |
| needs: check-and-update-readme | |
| if: needs.check-and-update-readme.outputs.changes-found == 'true' | |
| 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 issue content file | |
| run: | | |
| echo "A new branch has been created: **${{ env.BRANCH_NAME }}**." > issue-content.md | |
| echo "" >> issue-content.md | |
| echo "Please review the changes and open a pull request from this branch." >> issue-content.md | |
| echo "" >> issue-content.md | |
| echo "**Compare Changes:** [View on GitHub](https://github.com/RusherDevelopment/rusherhack-plugins/compare/gh-pages...${{ env.BRANCH_NAME }})" >> issue-content.md | |
| - name: Create an issue notification | |
| uses: peter-evans/create-issue-from-file@v4 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| title: "PR Needed: Update README" | |
| content-filepath: issue-content.md | |
| labels: "automated notification" |