Daily Update Meta #29
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: Daily Update Meta | |
| on: | |
| schedule: | |
| # Run daily at 2 AM UTC | |
| - cron: '0 2 * * *' | |
| workflow_dispatch: # Allow manual trigger | |
| jobs: | |
| update-meta: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run update:meta | |
| run: npm run update:meta | |
| - name: Check for changes | |
| id: changes | |
| run: | | |
| if ! git diff --quiet; then | |
| echo "changes=true" >> $GITHUB_OUTPUT | |
| echo "Changes detected in the following files:" | |
| git diff | |
| else | |
| echo "changes=false" >> $GITHUB_OUTPUT | |
| echo "No changes detected." | |
| fi | |
| - name: Commit and push changes | |
| if: steps.changes.outputs.changes == 'true' | |
| run: | | |
| git config --global user.name 'github-actions[bot]' | |
| git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
| git add . | |
| git commit -m "chore: Daily update metadata" -m "Generated by daily GitHub Actions workflow" | |
| git push origin main | |
| - name: Report status | |
| run: | | |
| if [ "${{ steps.changes.outputs.changes }}" == "true" ]; then | |
| echo "✅ Meta data updated and changes pushed to main" | |
| else | |
| echo "ℹ️ No changes detected, nothing to commit" | |
| fi |