Skip to content

Fix npm publish workflow EOTP failures by preferring GitHub trusted publishing - #12

Merged
codewithshinde merged 2 commits into
mainfrom
copilot/fix-publish-job-failure
Aug 1, 2026
Merged

Fix npm publish workflow EOTP failures by preferring GitHub trusted publishing#12
codewithshinde merged 2 commits into
mainfrom
copilot/fix-publish-job-failure

Conversation

Copilot AI commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

The publish GitHub Actions job failed on npm publish with EOTP, blocking release publication of @mitii/* packages. This change updates the publish path to use GitHub OIDC trusted publishing by default, with token-based auth retained as fallback.

  • Publish auth flow (script)

    • Updated scripts/publish-npm.cjs to:
      • detect GitHub Actions OIDC context,
      • publish with --provenance under trusted publishing (without token env),
      • retry with token auth only if trusted publish fails and a token is available.
    • Keeps existing non-Actions/local token behavior intact.
  • Workflow gate (CI)

    • Updated .github/workflows/npm-publish.yml precheck to require either:
      • OIDC trusted publishing context, or
      • NPM_TOKEN fallback.
    • Clarifies workflow intent in header/comments.
  • Release docs

    • Updated docs/RELEASE.md to reflect OIDC-first npm publishing and NPM_TOKEN as optional fallback.
if (hasGithubOidc) {
  const trustedEnv = { ...process.env };
  delete trustedEnv.NODE_AUTH_TOKEN;
  delete trustedEnv.NPM_TOKEN;

  result = publishWithPnpm(name, ['--access', 'public', '--no-git-checks', '--provenance'], trustedEnv);

  if ((result.status ?? 1) !== 0 && hasToken) {
    result = publishWithPnpm(name, ['--access', 'public', '--no-git-checks']);
  }
}

Copilot AI changed the title [WIP] Fix failing GitHub Actions job 'publish' Fix npm publish workflow EOTP failures by preferring GitHub trusted publishing Aug 1, 2026
Copilot AI requested a review from codewithshinde August 1, 2026 19:57
@codewithshinde
codewithshinde marked this pull request as ready for review August 1, 2026 20:34
@codewithshinde
codewithshinde merged commit acd1fcf into main Aug 1, 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