Update Counters #2
This file contains 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 Counters | |
on: | |
schedule: | |
- cron: '30 20 1 * *' # This triggers at 21:30 (Paris time) on the first day of each month | |
jobs: | |
update_counters: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v2 | |
- name: Set up Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '18' | |
- name: Install Dependencies | |
run: npm install | |
- name: Run Update Counters Script | |
run: node .github/scripts/update-counters.js | |
- name: Create New Branch | |
run: | | |
git config user.email "actions@github.com" | |
git config user.name "GitHub Actions" | |
git checkout -b update-counters-${{ github.run_id }} | |
git add . | |
git commit -m "Update counters" | |
git push origin update-counters-${{ github.run_id }} | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v3 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
branch: update-counters-${{ github.run_id }} | |
base: main | |
title: "Update Counters" | |
body: "Automated update of counters." |