Skip to content

ci: do not run install hooks in the TypeScript 7 canary - #36

Merged
kkdev92 merged 1 commit into
mainfrom
ci/ignore-scripts-ts7-canary
Aug 13, 2026
Merged

ci: do not run install hooks in the TypeScript 7 canary#36
kkdev92 merged 1 commit into
mainfrom
ci/ignore-scripts-ts7-canary

Conversation

@kkdev92

@kkdev92 kkdev92 commented Aug 13, 2026

Copy link
Copy Markdown
Owner

Follow-up on code scanning alert #4 (Pinned-Dependencies, ci.yml:178, score 9/10).

The alert is real, and the right answer is to keep the finding

The line it points at is npm install --no-save typescript@7 in the non-blocking typescript7 lane. The unpinnedness is the feature: the lane compiles the package against whatever npm's latest resolves to today, so pinning it turns a canary into a fixed target and removes the only signal it produces.

Verified rather than assumed:

  • Pinning a version would not clear the check anyway. Scorecard's isNpmUnpinnedDownload returns true for npm install regardless of the specifier, false only for npm ci, and there is no mechanism to mark a step intentionally unpinned.
  • The gap it watches is current. npm latest for typescript is 7.0.2; this repo builds ~6.0.3; typescript-eslint@8.67.0 declares typescript >=4.8.4 <6.1.0.
  • The lane is healthy — 8 of the last 8 runs on main passed, so TS7 compiles the package fine today.
  • The alert is current, not stale — its latest instance is on 39e944d6, this branch's merge base. (The line number is off by one: the run: is on 177 and Scorecard attributes 178.)

A dedicated lockfile plus npm ci would satisfy the check, but the canary would then track "whatever Dependabot last bumped" instead of latest — reintroducing the lag the lane exists to remove — for a lane that is deliberately non-blocking.

So the alert is dismissed as accepted, with that reasoning recorded on it.

What this PR does change

--ignore-scripts. The one unpinned install in this repository has no reason to run lifecycle hooks, and this removes that code path. The job's exposure was already narrow — it inherits contents: read, references no secrets, uploads no artefacts, and is continue-on-error — so this is the last piece rather than the main one.

Verified locally with the exact command: typescript@7.0.2 installs and tsc -b tsconfig.build.json --force exits 0.

Comment

Rewritten to separate the two reasons for staying on 6.0.x. Only typescript-eslint (and its parser) declares a typescript peer range — vitest, vite, @vitest/coverage-v8 and knip declare none — so it is the one to re-check when it lifts. That the wider toolchain is not ready in practice is a separate reason, and not one a peer range will tell you.

🤖 Generated with Claude Code

The lane resolves `typescript@latest` on purpose — it is a canary against
a moving target, and pinning it would remove the only thing it measures.
So the unpinned install stays, and Scorecard's Pinned-Dependencies finding
is accepted rather than satisfied. Checked against Scorecard's source:
version pinning does not clear that check either, only a lockfile install
does, and there is no way to mark a step intentionally unpinned.

What can be improved without touching the purpose is the install itself.
`--ignore-scripts` removes lifecycle-hook execution from the one unpinned
install in this repository. The job's exposure was already small — it
inherits `contents: read`, references no secrets and uploads no artefacts
— and this takes out the remaining code path.

Verified locally with the exact command: installs 7.0.2, and
`tsc -b tsconfig.build.json --force` still exits 0.

The comment now separates the two reasons for staying on 6.0.x. Only
typescript-eslint declares a `typescript` range (`>=4.8.4 <6.1.0`), and
it is the only dev dependency that declares one at all — vitest, vite and
knip declare none — so it is the thing to re-check when it lifts. That
the wider toolchain is not ready in practice is the other reason, and not
one a peer range will tell you.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@kkdev92
kkdev92 merged commit cca44d1 into main Aug 13, 2026
10 checks passed
@kkdev92
kkdev92 deleted the ci/ignore-scripts-ts7-canary branch August 13, 2026 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant