fix(ci): NPM_TOKEN auth fallback for npm publish#97
Merged
Conversation
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>
🔍 Hypatia Security ScanFindings: 31 issues detected
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
```
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:
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