diff --git a/.github/workflows/studio-frontend-ci.yml b/.github/workflows/studio-frontend-ci.yml index b5a7efb29..3abfea845 100644 --- a/.github/workflows/studio-frontend-ci.yml +++ b/.github/workflows/studio-frontend-ci.yml @@ -17,6 +17,8 @@ on: - 'studio/frontend/**' - 'scripts/check_frontend_dep_removal.py' - 'tests/studio/test_frontend_dep_removal.py' + - 'scripts/sync_allow_scripts_pins.py' + - 'tests/studio/test_sync_allow_scripts_pins.py' - '.github/workflows/studio-frontend-ci.yml' push: branches: [main, pip] @@ -68,6 +70,14 @@ jobs: working-directory: ${{ github.workspace }} run: python3 scripts/lockfile_supply_chain_audit.py + # Dependency bumps strand the version-pinned allowScripts entries. + # The paired pre-commit hook auto-fixes PRs; this is the backstop. + - name: allowScripts pins must match the lockfile + working-directory: ${{ github.workspace }} + run: | + python3 tests/studio/test_sync_allow_scripts_pins.py + python3 scripts/sync_allow_scripts_pins.py --check + - name: Lockfile must agree with package.json (npm ci is strict) # The vite 8 chain (rolldown, lightningcss, tailwind oxide) ships napi # binaries with no install scripts. The only script-bearing deps are diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 56d32c931..cffbf73cd 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -19,3 +19,15 @@ repos: exclude: '(chat_templates|ollama_template_mappers|_auto_install|mapper)\.py$' additional_dependencies: - ruff==0.6.9 + # Re-pins allowScripts entries after dependency bumps. pre-commit.ci + # pushes the fix to PR branches, Dependabot's included, so stale pins + # heal without a human in the loop. + - id: sync-allow-scripts-pins + name: Sync allowScripts pins with the frontend lockfile + # `python