Update Catalog #48
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 Catalog | |
| on: | |
| schedule: | |
| - cron: '0 6 * * *' # Every day at 06:00 UTC | |
| workflow_dispatch: | |
| inputs: | |
| reason: | |
| description: "Why are you running this update manually?" | |
| required: false | |
| default: "Manual refresh" | |
| permissions: | |
| contents: write | |
| jobs: | |
| update: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.12' | |
| - name: Install dependencies | |
| run: pip install -r scripts/requirements.txt | |
| - name: Log trigger context | |
| run: | | |
| echo "Event: ${{ github.event_name }}" | |
| echo "Reason: ${{ github.event.inputs.reason || 'Scheduled run' }}" | |
| - name: Run catalog update | |
| run: python scripts/update_catalog.py | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.CATALOG_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} | |
| - name: Commit and push if changed | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| if git diff --quiet README.md site/catalog.json; then | |
| echo "No catalog changes to commit" | |
| exit 0 | |
| fi | |
| git add README.md site/catalog.json | |
| git commit -m "chore: update app catalog $(date +%Y-%m-%d)" | |
| git push |