Skip to content

ci: enable npm provenance so the publish job keeps its OIDC permission - #2

Merged
dbotwinick merged 1 commit into
mainfrom
develop
Jul 25, 2026
Merged

ci: enable npm provenance so the publish job keeps its OIDC permission#2
dbotwinick merged 1 commit into
mainfrom
develop

Conversation

@dbotwinick

Copy link
Copy Markdown
Contributor

The v0.2.2 npm publish failed with a 404 on PUT for a package that plainly exists — npm's way of reporting an authorization failure for a scoped package. The generated workflow declared id-token: write at workflow level but the publish job re-declared permissions: contents: read, and a job-level block replaces the workflow one rather than merging. The job therefore had no OIDC token, npm could not sign provenance, and the publish fell back to plain token auth, which this package rejects.

repo-tools 0.1.19 derives both permission blocks from the same predicate so the file can no longer claim a permission its jobs do not get. use_provenance: true is what turns that predicate on here, restoring the configuration the hand-written workflow had: id-token at both levels, --provenance on the publish, and NODE_AUTH_TOKEN still supplied — the token and OIDC are used together.

Worth recording that this is not a regression introduced by the migration. The v0.2.1 and v0.1.60 tag runs failed identically and those releases reached npm by dispatching the workflow manually from main, so the token-only path has never worked for this package; the hand-written workflow simply happened to keep the permission that made the OIDC path available.

The rest of the v0.2.2 release came out green on the generated workflows: Publish (Go) verified all four module tags on its first live run, Publish (Python) shipped both projects, and Build & push Docker images completed with the aetherlite-dev -> aetherlite image_name override.

The v0.2.2 npm publish failed with a 404 on PUT for a package that plainly
exists — npm's way of reporting an authorization failure for a scoped package.
The generated workflow declared `id-token: write` at workflow level but the
publish job re-declared `permissions: contents: read`, and a job-level block
replaces the workflow one rather than merging. The job therefore had no OIDC
token, npm could not sign provenance, and the publish fell back to plain token
auth, which this package rejects.

repo-tools 0.1.19 derives both permission blocks from the same predicate so the
file can no longer claim a permission its jobs do not get. `use_provenance: true`
is what turns that predicate on here, restoring the configuration the
hand-written workflow had: id-token at both levels, `--provenance` on the publish,
and NODE_AUTH_TOKEN still supplied — the token and OIDC are used together.

Worth recording that this is not a regression introduced by the migration. The
v0.2.1 and v0.1.60 tag runs failed identically and those releases reached npm by
dispatching the workflow manually from main, so the token-only path has never
worked for this package; the hand-written workflow simply happened to keep the
permission that made the OIDC path available.

The rest of the v0.2.2 release came out green on the generated workflows:
Publish (Go) verified all four module tags on its first live run, Publish
(Python) shipped both projects, and Build & push Docker images completed with
the aetherlite-dev -> aetherlite image_name override.
@dbotwinick
dbotwinick merged commit 30cdc11 into main Jul 25, 2026
40 checks passed
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