Skip to content

Record why the first SDK publish failed, and check the token authenticates - #55

Merged
its-janghoon merged 1 commit into
developfrom
feature/publish-sdk-token-requirements
Sep 22, 2026
Merged

its-janghoon merged 1 commit into
developfrom
feature/publish-sdk-token-requirements

Conversation

@its-janghoon

Copy link
Copy Markdown
Contributor

The publish path from #53 / #54 works. The real run got all the way to Publishing to https://registry.npmjs.org/ with tag latest and public access and then:

npm error code EOTP
npm error This operation requires a one-time password.

The token authenticated. What it is not is exempt from the two-factor requirement npm enforces on publish. Only two credentials are:

  • a classic token of type Automation — a classic Publish token still prompts for an OTP
  • a granular access token with read-and-write on this package or scope

There is no workflow-side fix, and that is the point of the exemption: CI cannot supply an interactive one-time password. Recorded at the top of the workflow so nobody spends another run discovering it.

The pre-flight check was worse than nothing

It tested for a non-empty string, passed, and was followed by a publish that failed on auth policy — a green step implying the credential was good. It now runs npm whoami, and says plainly that 2FA exemption is only provable by the publish itself rather than claiming the credential is fine.

Still blocked downstream

The desktop-app migration off @opencode-ai/sdk cannot land until @redrob-code/sdk exists on the registry — pointing 31 references at a package that 404s breaks its install.

…uthenticates

The first real run got as far as "Publishing to registry.npmjs.org" and then failed
with `EOTP: This operation requires a one-time password`. So the token authenticated
fine; what it is not is exempt from the two-factor requirement npm enforces on
publish. Only a classic AUTOMATION token or a granular access token with write on
the scope is -- a classic "Publish" token still prompts.

There is no workflow-side fix, which is the point of the exemption: CI cannot supply
an interactive one-time password. Recorded at the top of the workflow so the next
person does not spend a run discovering it.

The pre-flight check now runs `npm whoami` rather than testing for a non-empty
string. The old check passed and was followed by a publish that failed on auth --
worse than no check, because a green step implied the credential was good. `whoami`
still cannot prove 2FA exemption, so the message says so instead of claiming the
credential is fine.
@its-janghoon
its-janghoon merged commit 7a0d939 into develop Sep 22, 2026
15 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.

1 participant