Skip to content

Fix release authentication with npm trusted publishing - #317

Merged
nahiyankhan merged 1 commit into
mainfrom
fix/npm-trusted-publishing
Dec 1, 2026
Merged

nahiyankhan merged 1 commit into
mainfrom
fix/npm-trusted-publishing

Conversation

@nahiyankhan

Copy link
Copy Markdown
Collaborator

Category: infrastructure
User Impact: Restore the release pipeline so pending ghost updates can reach npm and downstream distributions.
Problem: Main's quality gate and docs deploy pass, but the Release run fails publishing 0.35.1 with npm E404 on the package PUT. The workflow supplies a legacy publish token; logs cannot distinguish token expiry, lost access, or a publishing-policy restriction.
Solution: Remove the token mappings and setup-node token-auth configuration so the pinned Changesets action uses GitHub OIDC. Preserve the existing publish/output flow, add regression checks, and document npm-side setup.

Merge prerequisite: npm package-owner setup

Before merging, configure a GitHub Actions trusted publisher for @design-intelligence/ghost:

  • Organization: block; repository: ghost.
  • Workflow filename: release.yml; environment: blank.
  • Explicitly allow direct npm publish. Stage-only authorization does not permit Changesets publishing.

Create it close to merge: npm requires its first successful publish within two days. CI on this PR cannot validate npm-side authorization. After merge, verify npm publication, the GitHub Release/tarball, and configured downstream syncs before revoking the obsolete token and removing its repository secret. No release has been retried or dispatched as part of this patch.

Validation:

  • pnpm exec vitest run packages/ghost/test/release-workflows.test.ts: 11 tests pass.
  • node scripts/check-release-workflows.mjs: passes.
  • node scripts/check-terminology.mjs: passes.
  • pnpm exec biome check scripts/check-release-workflows.mjs packages/ghost/test/release-workflows.test.ts: passes.
  • git diff --check: passes.
  • Full quality:all: not reached. Frozen installs repeatedly fail because Cloudflare Gateway returns HTML block pages for npm dependency tarball URLs, causing integrity failures. Lockfile/checksums are unchanged; integrity verification remains enabled. Local commit/push hooks were skipped for this draft because they rerun the full suite against the incomplete install. GitHub CI must pass before merge.

Changeset: Not needed: CI authentication, internal checks/tests, and maintainer documentation only; no public package behavior changes.

ghost Review: Not run: no surface, guidance corpus, generation behavior, or review-packet changes.

File changes
  • .github/workflows/release.yml: remove both npm publish-token mappings and setup-node registry-url; retain OIDC permission and the Changesets release flow.
  • scripts/check-release-workflows.mjs: enforce the tokenless authentication contract alongside existing release assertions.
  • packages/ghost/test/release-workflows.test.ts: exercise passing workflows and auth/publishing regressions using temporary workflow copies.
  • CONTRIBUTING.md: document exact trusted-publisher settings, migration sequencing, and authorization-verification limits.

Screenshots/Demos: N/A.

@nahiyankhan
nahiyankhan force-pushed the fix/npm-trusted-publishing branch from ca5c915 to 34af0e3 Compare December 1, 2026 19:18
@nahiyankhan
nahiyankhan marked this pull request as ready for review December 1, 2026 19:25
@nahiyankhan
nahiyankhan merged commit 7507597 into main Dec 1, 2026
6 checks passed
@nahiyankhan
nahiyankhan deleted the fix/npm-trusted-publishing branch December 1, 2026 19:31
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