Skip to content

fix(ci): grant id-token: write at release-please.yml top level#115

Merged
theagenticguy merged 1 commit into
mainfrom
fix/release-please-permissions-ceiling
May 15, 2026
Merged

fix(ci): grant id-token: write at release-please.yml top level#115
theagenticguy merged 1 commit into
mainfrom
fix/release-please-permissions-ceiling

Conversation

@theagenticguy
Copy link
Copy Markdown
Owner

Summary

Top-level permissions: contents: read in .github/workflows/release-please.yml was capping every job below it. The release job (which fans out to release.yml via workflow_call for the npm-publish step) declared id-token: write and contents: write at its own job level, but those declarations are silently a no-op when not in the top-level set.

Verified by inspecting the failing job's log header:

GITHUB_TOKEN Permissions
  Contents: read
  Metadata: read

id-token: write missing despite being declared at the job level in release.yml.

This is the root cause of every recent npm-publish failure on this repo:

Skipped OIDC: ERR_PNPM_AUTH_TOKEN_EXCHANGE: Failed token exchange request
with body message: Unknown error (status code 404)

The 404 isn't from npm rejecting trust — it's from GitHub returning no OIDC token because id-token: write wasn't actually granted to the runner. Verified all 17 @opencodehub/* packages already have the correct trust relationship (release.yml + theagenticguy/opencodehub) configured on npmjs.com via npm trust list.

Fix

Top-level permissions: is now the union of every permission used by any job, including those reached transitively via workflow_call. Each job continues to narrow to its own least-privilege subset, so Scorecard's Token-Permissions check still passes.

Test plan

  • npm trust list @opencodehub/cli → confirms trust relationship exists with workflow release.yml
  • Merge this PR. Push to main triggers Release Please workflow.
  • release-please opens release PR with version bumps from PR feat!: WASM-only parser path; drop native tree-sitter from runtime #113's feat!:
  • Merge release PR → release.yml's npm-publish job → all 17 packages publish with provenance.
  • npm view @opencodehub/cli version returns 0.4.0
  • npm install -g @opencodehub/cli@latest works on a clean machine

Provenance

Durable lesson persisted: .erpaval/solutions/conventions/workflow-call-permissions-ceiling.md

The release.yml npm-publish job's `id-token: write` permission was
silently dropped because the calling workflow (release-please.yml) had
top-level `permissions: contents: read`. Per-job permissions can only
narrow the top-level ceiling; they cannot grant permissions the top
level didn't include.

Symptom on every release attempt:

  Skipped OIDC: ERR_PNPM_AUTH_TOKEN_EXCHANGE: Failed token exchange
  request with body message: Unknown error (status code 404)

The job's GITHUB_TOKEN Permissions block in the run log showed only
`Contents: read, Metadata: read` — `id-token: write` was missing despite
being declared at the job level in release.yml.

Fix: top-level `permissions:` now lists every permission used by any
job, including transitively via workflow_call. Each job still narrows
to its own least-privilege subset, so Scorecard's Token-Permissions
check still passes.

Trusted publisher relationships were already correctly configured for
all 17 @opencodehub/* packages; the OIDC failure was downstream of npm,
purely a GitHub Actions permission propagation bug.

Durable lesson:
.erpaval/solutions/conventions/workflow-call-permissions-ceiling.md
@theagenticguy theagenticguy force-pushed the fix/release-please-permissions-ceiling branch from b741791 to ed05bba Compare May 15, 2026 15:36
@theagenticguy theagenticguy merged commit a87a6eb into main May 15, 2026
30 of 34 checks passed
@theagenticguy theagenticguy deleted the fix/release-please-permissions-ceiling branch May 15, 2026 15:41
@github-actions github-actions Bot mentioned this pull request May 15, 2026
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