Skip to content

Publish from CI with npm trusted publishing - #4

Merged
kecsou merged 1 commit into
masterfrom
claude/wmctrljs-trusted-publishing
Oct 31, 2026
Merged

kecsou merged 1 commit into
masterfrom
claude/wmctrljs-trusted-publishing

Conversation

@kecsou

@kecsou kecsou commented Oct 31, 2026

Copy link
Copy Markdown
Owner

Summary

The v2.0.0 tag's publish job could not have worked, for two reasons:

  • No NPM_TOKEN secret: the repository never had one.
  • Provenance check: npm publish --provenance checks repository.url against the repository running the workflow. package.json still said Kmynes/wmctrljs, the account's former name.

This PR:

  • package.json: repository, bugs and homepage point at kecsou/wmctrljs.
  • Publish job: uses npm trusted publishing. npm accepts this workflow's OIDC token (id-token: write was already set) instead of an npm token, and adds provenance on its own. The secret and --provenance are gone. The job runs on Node 24, because trusted publishing needs npm 11.5.1+.
  • README: says how CI publishes.

The version stays 2.0.0. 2.0.0 is already on npm, and this changes no published code.

Before the next release

npm must list this workflow as the package's trusted publisher. Run this once, as the package owner:

npm trust github wmctrljs --file ci.yml --repo kecsou/wmctrljs --allow-publish

Or set it on npmjs.com under the package's Settings, Trusted Publisher, GitHub Actions: kecsou / wmctrljs / ci.yml.

Test plan

  • The workflow parses as YAML
  • The publish job only runs on a v* tag, so the next release is its real test

🤖 Generated with Claude Code

The publish job needed an NPM_TOKEN secret the repository never had,
and its provenance check would have failed anyway: package.json still
pointed at Kmynes/wmctrljs, the account's former name. npm now accepts
the workflow's OIDC token instead of an npm token. That needs npm
11.5.1+, so the job runs on Node 24, and npm adds provenance on its own.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kecsou
kecsou merged commit ef7100a into master Oct 31, 2026
17 checks passed
@kecsou
kecsou deleted the claude/wmctrljs-trusted-publishing branch October 31, 2026 21:49
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