Skip to content

ci: publish to npm from CI with OIDC trusted publishing - #5028

Merged
yusukebe merged 1 commit into
mainfrom
ci/npm-ci-oidc
Jun 18, 2026
Merged

yusukebe merged 1 commit into
mainfrom
ci/npm-ci-oidc

Conversation

@yusukebe

Copy link
Copy Markdown
Member

Currently, I publish an npm package manually using the release script, which runs the np command on my local machine. This has a risk of enabling supply chain attacks. If my machine is hijacked, the package may contain malicious things.

In this PR, switch the release to np --no-publish so the local step only bumps the version and pushes the tag. Plus, I added the CI script to release.yml to release to npm using OIDC trusted publishing with provenance.

The author should do the following, if applicable

  • Add tests
  • Run tests
  • bun run format:fix && bun run lint:fix to format the code
  • Add TSDoc/JSDoc to document the code

@github-actions

Copy link
Copy Markdown

HTTP Performance Benchmark

Framework Runtime Average Ping Query Body
hono (origin/main) bun 49,447.10 61,067.83 48,044.83 39,228.63
hono (current) bun 49,487.32 61,116.23 47,886.00 39,459.74
Change +0.08% +0.08% -0.33% +0.59%

@codecov

codecov Bot commented Jun 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.01%. Comparing base (e50df01) to head (993200f).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5028   +/-   ##
=======================================
  Coverage   79.01%   79.01%           
=======================================
  Files         154      154           
  Lines       10578    10578           
  Branches     2215     2215           
=======================================
  Hits         8358     8358           
  Misses       2220     2220           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@yusukebe

Copy link
Copy Markdown
Member Author

Hey @BarryThePenguin !

Can you review this? If it's okay, I'll merge this and set up the Trusted Publisher on the npm site.

@BarryThePenguin BarryThePenguin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

I'm guessing that your workflow is

  • npm run release locally to bump version, commit and push with tag
  • npm publish in CI when the tag is pushed

@yusukebe

Copy link
Copy Markdown
Member Author

@BarryThePenguin Thanks! We will change the release workflow to make it safer!

@yusukebe
yusukebe merged commit c574cf1 into main Jun 18, 2026
20 checks passed
@yusukebe
yusukebe deleted the ci/npm-ci-oidc branch June 18, 2026 01:04
@yusukebe

Copy link
Copy Markdown
Member Author

It succeeded!

CleanShot 2026-06-18 at 11 25 04@2x

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