Repository navigation
Catalog sync #210
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: Catalog sync | |
| on: | |
| schedule: | |
| - cron: "0 */6 * * *" | |
| workflow_dispatch: | |
| inputs: | |
| force: | |
| description: Re-extract even if command-code version is unchanged | |
| type: boolean | |
| default: false | |
| permissions: | |
| contents: write | |
| issues: write | |
| jobs: | |
| sync: | |
| name: catalog-push | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: "1.3.14" | |
| - name: Install dependencies | |
| run: bun install --frozen-lockfile | |
| - name: Ensure automation labels | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| gh label create catalog-break --force --color B60205 \ | |
| --description "Catalog model extraction failed in CI" || true | |
| # 路线 A(gfwlist 式):检测到上游 command-code 新版本即重新提取 models.json, | |
| # 并直接提交推送到 main(不经 PR、不触发 npm 发版)。提交信息仿照 gfwlist 的 | |
| # "models.json edited <UTC time>" 风格。插件运行时从 raw URL 拉取即生效。 | |
| - name: Sync catalog and push to main | |
| env: | |
| CI: "true" | |
| FORCE: ${{ inputs.force }} | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: bun run scripts/catalog-sync-ci.ts |