ui-ux-pro-max-skill/.github/workflows/check-asset-sync.yml
Alexander b4d33beada
fix CLI asset sync (#355)
* fix CLI asset sync

* fix(cli): normalize line endings in asset sync/check

check:assets hashed raw bytes, so identical CSV/JSON/py content with
CRLF vs LF (git autocrlf on checkout) was reported as stale drift,
blocking the release guard on Windows/mixed checkouts.

- fileHash now normalizes CRLF->LF before hashing, so check:assets
  compares content, not line endings.
- sync:assets writes LF-normalized copies instead of a raw byte copy,
  so re-syncing is deterministic across platforms.

All synced assets are text (csv/json/md/py); no binaries affected.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* ci: enforce CLI asset sync on PRs

Adds a Check asset sync workflow that runs `npm run check:assets` on any
PR touching src/ui-ux-pro-max/** or cli/assets/**, so the bundled CLI
assets can't silently drift from the source of truth.

The check uses only node builtins (no install step) and normalizes
line endings before hashing, so it hard-fails on real content drift
without the CRLF/LF soft-fail hack other approaches needed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-25 12:54:58 +07:00

30 lines
849 B
YAML

name: Check asset sync
on:
pull_request:
paths:
- "src/ui-ux-pro-max/**"
- "cli/assets/**"
- "cli/scripts/sync-assets.mjs"
- ".github/workflows/check-asset-sync.yml"
push:
branches: [main]
paths:
- "src/ui-ux-pro-max/**"
- "cli/assets/**"
jobs:
check-assets:
name: cli/assets must match src/ui-ux-pro-max
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
# check:assets runs `node scripts/sync-assets.mjs --check`, which uses only
# node builtins (no npm install needed) and normalizes CRLF/LF before
# hashing, so it compares content rather than line endings.
- name: Check CLI assets are in sync with source of truth
run: npm --prefix cli run check:assets