-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (39 loc) · 1.23 KB
/
sync_data.yml
File metadata and controls
47 lines (39 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
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'
})