Skip to content

🔒 Fix release publishing with npm OIDC - #907

Open
Robdel12 wants to merge 1 commit into
mainfrom
rd/fix-release-publishing
Open

Robdel12 wants to merge 1 commit into
mainfrom
rd/fix-release-publishing

Conversation

@Robdel12

Copy link
Copy Markdown
Collaborator

Why

The November 11 release reached npm publish only after committing version changes to main and force-updating the release tag. It attempted interactor.js@3.6.1, which had already been published on March 31; 3.6.2 is also already on npm. The publishing step failed, although GitHub's log-download endpoints currently return 502, so its exact npm error could not be retrieved.

The workflow also still relies on a long-lived NPM_TOKEN instead of trusted publishing.

Approach

Publish the immutable release tag with npm OIDC credentials and provenance. Keep checkout read-only, remove branch/tag mutations, and reject tag/version mismatches or versions already on npm before building. Pin an OIDC-capable npm CLI, install dependencies without lifecycle scripts, explicitly build and check declarations, and publish prereleases under next.

Release versions now need to be bumped in a PR before creating the matching GitHub release. The workflow never changes an existing tag to make a package version fit.

Evidence

Workflow validation passes. The actual version guard rejects the already-published 3.6.1, rejects a mismatched v3.6.2 tag, and accepts unpublished 3.6.3. The release build and type checks pass, and the package dry run includes the bundle and declarations.

Required npm setup

An npm package maintainer must authorize wwilsman/interactor.js → release.yml, with no environment and direct npm publish allowed, before the first OIDC release. The exact setup is documented in .github/RELEASING.md. Current CLI authentication cannot configure or inspect that publisher, and npm lists wwilsman as the package maintainer. No credentials were changed and no package was published.

Publish immutable release tags with short-lived OIDC credentials instead of the long-lived npm token. Reject mismatched or already-published versions before building, and remove the workflow's main-branch commits and forced tag updates.

Document the required npm trusted publisher and release version process. Keep release installs uncached, validate generated types, and publish provenance with the correct stable or prerelease dist-tag.
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