Update README with Plugins List #56
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 with Plugins List | |
| on: | |
| push: | |
| paths: | |
| - 'badges.json' # Trigger only when badges.json is updated on gh-pages | |
| workflow_dispatch: # Allows manual trigger | |
| jobs: | |
| update-readme: | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| ref: main | |
| - name: Fetch badges.json from gh-pages | |
| run: | | |
| git fetch origin gh-pages | |
| git checkout origin/gh-pages -- badges.json | |
| echo "::notice::Pulled badges.json from gh-pages branch." | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: '18' | |
| - name: Generate new README | |
| run: node update-readme.js | |
| - name: Check for changes in README.md | |
| id: check_changes | |
| run: | | |
| git add README.md | |
| if git diff --cached --quiet; then | |
| echo "::notice::No changes detected in README.md." | |
| echo "skip=true" >> $GITHUB_ENV | |
| else | |
| echo "::notice::Changes detected in README.md." | |
| fi | |
| - name: Commit changes and create a new branch | |
| if: env.skip != 'true' | |
| id: set-branch-name | |
| 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 | |
| git checkout -b $BRANCH_NAME | |
| git commit -m "Update README with latest plugins list" | |
| git push origin $BRANCH_NAME | |
| - name: Create issue content file | |
| run: | | |
| echo "**PR Needed: Update README**" > issue-content.md | |
| echo "" >> issue-content.md | |
| 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/${{ github.repository }}/compare/gh-pages...${{ env.BRANCH_NAME }})" >> issue-content.md | |
| - name: Create GitHub Issue for PR Notification | |
| if: env.skip != 'true' | |
| 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" | |
| repository: ${{ github.repository }} |