ci: enable npm provenance so the publish job keeps its OIDC permission - #2
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: writeat workflow level but the publish job re-declaredpermissions: 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: trueis what turns that predicate on here, restoring the configuration the hand-written workflow had: id-token at both levels,--provenanceon 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.