Update Events from Luma #120
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 Events from Luma | |
| on: | |
| schedule: | |
| # Runs every day at 6 AM UTC | |
| - cron: '0 6 * * *' | |
| workflow_dispatch: # Allow manual trigger | |
| jobs: | |
| update-events: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Run scraper | |
| run: node scripts/scrape-events.js | |
| - name: Check for changes | |
| id: git-check | |
| run: | | |
| git diff --exit-code public/events.json || echo "changes=true" >> $GITHUB_OUTPUT | |
| - name: Commit and push changes | |
| if: steps.git-check.outputs.changes == 'true' | |
| run: | | |
| git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
| git config --local user.name "github-actions[bot]" | |
| git add -f public/events.json | |
| git commit -m "chore: update events from Luma" | |
| git push |