Check and Update Releases #10
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: Check and Update Releases | |
| on: | |
| schedule: | |
| - cron: '0 0 * * *' # Runs daily at midnight UTC | |
| workflow_dispatch: # Allows manual trigger | |
| jobs: | |
| check-releases: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: '18' | |
| - name: Install dependencies | |
| run: npm install axios | |
| - name: Check and update latest releases | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: node check-releases.js | |
| - name: Commit and push changes | |
| run: | | |
| git config --local user.name "GitHub Actions Bot" | |
| git config --local user.email "[email protected]" | |
| # Create and switch to a temporary branch | |
| git checkout -b update-releases | |
| # Stage and commit changes | |
| git add badges.json README.md | |
| git commit -m "Update badges.json and README.md with latest release URLs" || echo "No changes to commit" | |
| # Push changes and create a pull request | |
| git push origin update-releases | |
| - name: Create pull request | |
| uses: peter-evans/create-pull-request@v5 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| base: main | |
| branch: update-releases | |
| title: "Update badges.json and README.md" | |
| body: | | |
| This pull request updates: | |
| - `badges.json` with the latest release URLs. | |
| - `README.md` with updated GitHub download links. | |
| labels: "automated update" | |
| assignees: "Garlicrot" |