Skip to content

fix(ci): NPM_TOKEN auth fallback for npm publish#97

Merged
hyperpolymath merged 1 commit into
mainfrom
fix/publish-npm-token-fallback
May 20, 2026
Merged

fix(ci): NPM_TOKEN auth fallback for npm publish#97
hyperpolymath merged 1 commit into
mainfrom
fix/publish-npm-token-fallback

Conversation

@hyperpolymath
Copy link
Copy Markdown
Owner

Summary

Switch npm publish from OIDC Trusted Publisher to granular access token auth. Three publish attempts on v0.4.7 (and one each on prior tags going back to v0.4.1) returned the same 404 from npm — Trusted Publisher setup wouldn't take regardless of how the UI was configured. The token path is documented, reliable, and what npm uses in practice.

What changes

```diff
- name: Publish to npm
run: npm publish --provenance --access public

  •    env:
    
  •      NODE_AUTH_TOKEN: \${{ secrets.NPM_TOKEN }}
    

```

Two lines added. `actions/setup-node` already configures `registry-url` to npm, so `NODE_AUTH_TOKEN` is the conventional way to pass auth.

Provenance is preserved

The `--provenance` flag still works under token auth. The workflow's `permissions: id-token: write` is unchanged, so `npm publish --provenance` still generates a sigstore attestation inside the GitHub Actions OIDC environment. Token auth handles the upload; provenance attests what was published — these are separate.

Prerequisite (owner action, done in parallel)

A repo secret `NPM_TOKEN` must exist before this lands and the next re-tag fires the workflow. The token should be a granular access token scoped to:

  • Packages: `@hyperpolymath/boj-server` only
  • Permissions: Read and write

Created at https://www.npmjs.com/settings/~/tokens/granular/new.

JSR path unchanged

JSR Trusted Publisher works (v0.4.7 published successfully on the previous workflow run). The `publish-jsr` job is untouched.

Sequencing

Merge → user re-tags v0.4.7 → workflow uses NPM_TOKEN → npm gets 0.4.7. Glama re-scan window opens once the npm tarball is visible.

🤖 Generated with Claude Code

Trusted Publisher OIDC setup didn't take after multiple attempts —
npm consistently returns 404 on PUT. Switching to granular access
token auth, which is the documented npm path and is reliable.

Provenance signing is preserved: `npm publish --provenance` still
runs inside the GitHub Actions OIDC environment (`id-token: write`
permission unchanged), so the published tarball gets a sigstore
provenance attestation regardless of which auth mechanism handled
the upload itself. The token only authorises the publish API call;
provenance attests *what* was published, separately.

Requires repo secret NPM_TOKEN set to a granular access token
scoped to read+write on @hyperpolymath/boj-server.

JSR publish path is unchanged — JSR Trusted Publisher works (0.4.7
published successfully today).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

🔍 Hypatia Security Scan

Findings: 31 issues detected

Severity Count
🔴 Critical 19
🟠 High 5
🟡 Medium 7

⚠️ Action Required: Critical security issues found!

View findings
[
  {
    "reason": "Stale AI session file -- delete",
    "type": "stale",
    "file": "GEMINI.md",
    "action": "delete",
    "rule_module": "root_hygiene",
    "severity": "medium"
  },
  {
    "reason": "Issue in quality.yml",
    "type": "missing_workflow",
    "file": "quality.yml",
    "action": "create",
    "rule_module": "workflow_audit",
    "severity": "high"
  },
  {
    "reason": "Issue in security-policy.yml",
    "type": "missing_workflow",
    "file": "security-policy.yml",
    "action": "create",
    "rule_module": "workflow_audit",
    "severity": "medium"
  },
  {
    "reason": "Action hyperpolymath/standards/.github/workflows/governance-reusable.yml@main needs attention",
    "type": "unpinned_action",
    "file": "governance.yml",
    "action": "pin_sha",
    "rule_module": "workflow_audit",
    "severity": "high"
  },
  {
    "reason": "Python file detected -- banned language",
    "type": "banned_language_file",
    "file": "/home/runner/work/boj-server/boj-server/.github/scripts/validate-eclexiaiser.py",
    "action": "flag",
    "rule_module": "cicd_rules",
    "severity": "critical"
  },
  {
    "reason": "TypeScript file detected -- banned language",
    "type": "banned_language_file",
    "file": "/home/runner/work/boj-server/boj-server/cartridges/sanctify-mcp/adapter/mod.ts",
    "action": "flag",
    "rule_module": "cicd_rules",
    "severity": "critical"
  },
  {
    "reason": "TypeScript file detected -- banned language",
    "type": "banned_language_file",
    "file": "/home/runner/work/boj-server/boj-server/cartridges/academic-workflow-mcp/adapter/mod.ts",
    "action": "flag",
    "rule_module": "cicd_rules",
    "severity": "critical"
  },
  {
    "reason": "TypeScript file detected -- banned language",
    "type": "banned_language_file",
    "file": "/home/runner/work/boj-server/boj-server/cartridges/fireflag-mcp/adapter/mod.ts",
    "action": "flag",
    "rule_module": "cicd_rules",
    "severity": "critical"
  },
  {
    "reason": "TypeScript file detected -- banned language",
    "type": "banned_language_file",
    "file": "/home/runner/work/boj-server/boj-server/cartridges/ephapax-mcp/adapter/mod.ts",
    "action": "flag",
    "rule_module": "cicd_rules",
    "severity": "critical"
  },
  {
    "reason": "TypeScript file detected -- banned language",
    "type": "banned_language_file",
    "file": "/home/runner/work/boj-server/boj-server/cartridges/bofig-mcp/adapter/mod.ts",
    "action": "flag",
    "rule_module": "cicd_rules",
    "severity": "critical"
  }
]

Powered by Hypatia Neurosymbolic CI/CD Intelligence

@hyperpolymath hyperpolymath merged commit f52e9e4 into main May 20, 2026
16 of 19 checks passed
@hyperpolymath hyperpolymath deleted the fix/publish-npm-token-fallback branch May 20, 2026 07:22
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