Update README with Plugins List #53
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: | |
| branches: | |
| - gh-pages | |
| paths: | |
| - 'badges.json' | |
| 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 # Checkout the main branch first | |
| - name: Fetch gh-pages branch | |
| run: | | |
| git fetch origin gh-pages:gh-pages | |
| git checkout gh-pages -- badges.json | |
| echo "::notice::Pulled badges.json 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: 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 HEAD | |
| - 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/main...${{ 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 }} |