自荐: dsh-whale-musume v2.0.0 鲸鱼娘桌宠 #144
Workflow file for this run
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: Validate curated data | |
| on: | |
| pull_request: | |
| paths: | |
| - 'data/curated.json' | |
| - 'data/approved.json' | |
| - 'data/market.json' | |
| - 'CATALOG.md' | |
| - 'catalog/**' | |
| - 'README.md' | |
| - 'README_EN.md' | |
| - 'SHOWCASE.md' | |
| - 'scripts/**' | |
| - '.github/workflows/validate-curated.yml' | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: validate-curated-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| validate: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-node@v7 | |
| with: | |
| node-version: 22 | |
| - name: Validate data/curated.json | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: node scripts/validate-curated.mjs | |
| # Does the published catalog still agree with this PR's curation data — | |
| # or did someone edit approved.json / curated.json without re-running | |
| # scripts/merge.mjs? This compares which repository sits in which volume | |
| # plus the index links/counts, not bytes: volume pages carry star counts and a snapshot date that the | |
| # daily workflow moves every day, so a byte-level diff would fail on | |
| # unrelated PRs instead of reporting real drift. | |
| - name: Check the published catalog against the curation data | |
| run: node scripts/merge.mjs --check | |
| - name: Detect curation changes | |
| id: curation | |
| run: | | |
| if git diff --quiet "${{ github.event.pull_request.base.sha }}" HEAD -- data/approved.json data/curated.json; then | |
| echo "changed=false" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "changed=true" >> "$GITHUB_OUTPUT" | |
| fi | |
| # Smoke tests: both generators must run clean against the stored snapshot. | |
| # Neither writes anything CI keeps — the review queue and the board are | |
| # regenerated on main, by the daily workflow and by a review merge. | |
| - name: Refresh the review queue from the stored snapshot | |
| run: node scripts/update.mjs --from-snapshot | |
| - name: Regenerate the leaderboard from the stored snapshot | |
| run: node scripts/top.mjs | |
| # A curation PR is a review merge, so all user-facing generated pages must | |
| # be committed together. Exact comparison is intentionally conditional: | |
| # daily snapshot refreshes do not republish these pages, and requiring an | |
| # exact diff for unrelated documentation/script PRs would report normal | |
| # snapshot churn as an error. | |
| - name: Check all generated pages for a curation change | |
| if: steps.curation.outputs.changed == 'true' | |
| run: | | |
| node scripts/merge.mjs | |
| git status --porcelain -- CATALOG.md catalog TOP200.md README.md README_EN.md > /tmp/generated-pages.status | |
| if [ -s /tmp/generated-pages.status ]; then | |
| echo "Generated user-facing pages are not committed:" | |
| cat /tmp/generated-pages.status | |
| git diff -- CATALOG.md catalog TOP200.md README.md README_EN.md | |
| exit 1 | |
| fi | |
| # The market file is regenerated from the PR's own curation state so the | |
| # validator checks what main would publish after this PR merges (the | |
| # committed file is refreshed by refresh-market.yml on push to main). | |
| - name: Rebuild the downstream market file from the stored snapshot | |
| run: node scripts/market.mjs --from-snapshot | |
| - name: Validate the downstream market file | |
| run: node scripts/validate-market.mjs | |
| - name: Run the market pipeline tests | |
| run: node --test scripts/test-market.mjs |