Refresh last 30 sets #334
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: Refresh last 30 sets | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 0 * * *' # once a day | |
jobs: | |
refresh-last-30-sets: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.nvmrc' | |
- name: Fetch set cards and create a file for last 30 sets | |
run: | | |
node scripts/refresh-30-last-sets.js | |
git config --global user.email "no-reply@github.com" | |
git config --global user.name "GitHub Actions" | |
git add sets/* | |
if ! git diff-index --quiet HEAD; then | |
git commit -m "Update sets" | |
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }} | |
git push | |
fi |