Skip to content

ci: pin credential-holding third-party actions by sha and default ci.yml and check-links.yml to a read-only token - #13430

Merged
os-tesla merged 2 commits into
mainfrom
claude/project-thread-gl3pmg
Oct 24, 2026
Merged

os-tesla merged 2 commits into
mainfrom
claude/project-thread-gl3pmg

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Tesla · project thread

CI supply-chain hardening: every third-party action that runs holding a credential now names a commit sha, and the two workflows that had no permissions: block default the job token to read-only.

What changed

Third-party actions pinned by commit sha (each with a trailing # vX.Y.Z comment). Each one was the commit its floating ref resolved to when this was written, read with git ls-remote against the upstream repository:

workflow action was now credential it holds
changeset-release.yml (2 steps) changesets/action @v1 (a branch) a45c4d594aa4e2c509dc14a9f2b3b67ba3780d0d # v1.9.0 NPM_TOKEN, GITHUB_TOKEN
check-links.yml lycheeverse/lychee-action @v2 e7477775783ea5526144ba13e8db5eec57747ce8 # v2.9.0 GITHUB_TOKEN
dependabot-auto-merge.yml dependabot/fetch-metadata @v3 25dd0e34f4fe68f24cc83900b1fe3fe149efef98 # v3.1.0 github-token input
changelog.yml orhun/git-cliff-action @v4 a9a95522b26fe6403f7bb24031f21fb573d0f5ff # v4.9.1 job token by default (contents: write job)
  • changesets/action moves from the v1 branch to the v1.9.0 commit, which is the commit the workflow's own git-surface reading was already taken at, so the two properties the release lane depends on are unchanged. scripts/__tests__/changeset-release-action-ref-pin.test.ts now holds the sha, and gains one non-vacuity case: a step that goes back to the moving v1 reds.
  • The four are declared exceptions in scripts/check-action-ref-convention.mjs (the gate's mechanism for a deliberate off-convention ref), with one shared reason. The issue field names this pull request. First-party actions/* refs stay on the floating-tag default; the repo-wide pinning posture is not changed here.
  • half-state-patrol.yml was already sha-pinned and is untouched.

Least-privilege job token.

  • ci.yml: top-level permissions: contents: read. The seven jobs without their own block (changeset-check, type-check, test, test-dist-pins, test-coverage, e2e, docs) were measured for token use: no step passes GITHUB_TOKEN, github.token, gh, or github-script in any of them; actions/cache and actions/upload-artifact use the runner's own token. test-aggregate and coverage-report keep their existing contents: read + actions: read blocks. No job was widened.
  • check-links.yml: top-level permissions: contents: read; lychee's token is a read for API rate limits.

Dependabot. The github-actions ecosystem now runs weekly and groups minor/patch updates into one pull request, so the pinned shas get their updates. Majors stay separate, so a declined major (the deliberate changesets/action v1 hold) does not block the group. The npm entry is unchanged.

Verification

  • node scripts/check-action-ref-convention.mjs → exit 0: 141 refs in 28 workflow files, 13 distinct, 0 undeclared, 0 stale.
  • node scripts/check-changeset-presence.mjs → exit 0: no released package's source or contract changed, so no changeset is owed.
  • Vitest over changeset-release-action-ref-pin.test.ts, check-action-ref-convention.test.ts, check-links-workflow.test.ts: 33/33 passed once the exception entries name this PR. ⚠️ Run with a scratch vitest 4.1.10 + yaml 2.9.0 runner rather than the repo-root config (this container had no pnpm run setup build of the objectstack pin); CI's pnpm test is the authoritative run.

Governed surface

The diff touches .github/workflows/**, so this stays a draft until an authorized approval. Security change: the maintainer approves before merge.

  • Adds no product-specific widget, dialog, hook or string (see AGENTS.md › Product-neutral renderer)

Session: https://claude.ai/code/session_01W9H2WdXx3kPkf6moDnRdRE

🤖 Generated with Claude Code

https://claude.ai/code/session_01W9H2WdXx3kPkf6moDnRdRE

…yml/check-links.yml to a read-only token

- changesets/action, lycheeverse/lychee-action, dependabot/fetch-metadata and
  orhun/git-cliff-action now name a commit sha with a trailing version comment;
  each is a declared exception in check-action-ref-convention.mjs. The
  changesets ref-pin test now holds the v1.9.0 sha.
- ci.yml and check-links.yml declare a top-level `permissions: contents: read`.
- Dependabot's github-actions updates run weekly, minor/patch grouped.

Claude-Session: https://claude.ai/code/session_01W9H2WdXx3kPkf6moDnRdRE
Co-authored-by: Claude <noreply@anthropic.com>
@os-tesla
os-tesla marked this pull request as ready for review October 24, 2026 01:45
@os-tesla
os-tesla enabled auto-merge October 24, 2026 01:45
@os-tesla
os-tesla added this pull request to the merge queue Oct 24, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 24, 2026
@os-tesla
os-tesla added this pull request to the merge queue Oct 24, 2026
Merged via the queue into main with commit 7981384 Oct 24, 2026
34 checks passed
@os-tesla
os-tesla deleted the claude/project-thread-gl3pmg branch October 24, 2026 02:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants