Skip to content

fix(publish-fork): derive repository.url from current repo for provenance - #16

Merged
dogmar merged 1 commit into
mainfrom
claude/fix-publish-provenance-repo-url
May 29, 2026
Merged

dogmar merged 1 commit into
mainfrom
claude/fix-publish-provenance-repo-url

Conversation

@dogmar

@dogmar dogmar commented May 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes the Publish Fork workflow, where all 10 packages fail with:

npm error code E422
Error verifying sigstore provenance bundle: Failed to validate repository information:
package.json: "repository.url" is "git+https://github.com/dogmar/pacer.git",
expected to match "https://github.com/klink-ing/pacer" from provenance

Root cause

scripts/publish-fork.mjs rewrote each package's repository.url to a hardcoded dogmar/pacer — a stale slug left over from before the repo moved to the klink-ing org. The workflow publishes with --provenance in CI, which signs a sigstore attestation derived from the GitHub OIDC token (encoding the real source repo, klink-ing/pacer). The npm registry rejects the publish unless repository.url matches the provenance repo, so dogmar/pacer != klink-ing/pacer → E422 on every package.

(The Publish Dry Run workflow stays green because --dry-run signs provenance locally but never does the registry PUT, so the mismatch is never validated.)

Change

Derive the slug from GITHUB_REPOSITORY (the Actions context) instead of hardcoding it, so it tracks the real repo and won't drift on a future rename. Falls back to the current fork slug (klink-ing/pacer) for local runs:

const repoSlug = process.env.GITHUB_REPOSITORY ?? 'klink-ing/pacer'
pkg.repository.url = `git+https://github.com/${repoSlug}.git`

Impact

All 10 packages failed in the last run, so nothing was published — no partial/duplicate-version state to clean up. The next version bump (or a manual re-run) will publish cleanly once this lands.

Test plan

  • Merge and trigger a publish (via a version bump on main) → confirm packages publish without the E422 provenance error and repository.url in the published tarballs reads git+https://github.com/klink-ing/pacer.git.

Generated by Claude Code

…ance

The script rewrote repository.url to a hardcoded dogmar/pacer, left over
from before the repo moved to the klink-ing org. npm --provenance signs an
attestation from the GitHub OIDC token, and the registry rejects the
publish (E422) unless repository.url matches the repo that produced it —
so every package failed with dogmar/pacer != klink-ing/pacer.

Derive the slug from GITHUB_REPOSITORY (the Actions context) so it tracks
the real repo and won't drift on a future rename, falling back to the fork
slug for local runs.
@dogmar
dogmar marked this pull request as ready for review May 28, 2026 23:49
@dogmar
dogmar merged commit f8d4d57 into main May 29, 2026
3 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.

2 participants