Sync QYggdrasil Plugin Data #102
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: Sync QYggdrasil Plugin Data | |
| on: | |
| schedule: | |
| - cron: '0 0 * * *' # Daily at midnight UTC | |
| workflow_dispatch: # Allow manual triggering | |
| permissions: | |
| contents: write | |
| actions: write | |
| jobs: | |
| sync: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.x' | |
| - name: Fetch Latest Plugin Metadata | |
| run: | | |
| cd web | |
| python fetch_plugins.py | |
| - name: Commit and Push Changes | |
| run: | | |
| git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
| git config --local user.name "github-actions[bot]" | |
| git add web/data/plugins.json | |
| git diff --quiet && git diff --staged --quiet || (git commit -m "chore: sync plugin metadata [skip ci]" && git push) | |
| - name: Trigger Deploy Workflow | |
| if: success() | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| github.rest.actions.createWorkflowDispatch({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| workflow_id: 'deploy.yml', | |
| ref: 'main' | |
| }) |