Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ jobs:
runs-on: ubuntu-latest
permissions:
contents: write
# OIDC trusted publishing (npmjs.com → berget → Trusted Publisher:
# berget-ai/cli / publish.yml). No NPM_TOKEN needed — the old classic
# token expired, which made npm publish fail with a misleading 404.
id-token: write

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

good — Dropping the long-lived NPM_TOKEN in favor of short-lived OIDC trusted publishing is the right security posture.

steps:
# The repo ruleset requires PRs for GITHUB_TOKEN pushes to main.
# Checking out with the repo Deploy Key (SSH) makes the version-bump
Expand Down Expand Up @@ -72,7 +76,7 @@ jobs:
npm version ${{ inputs.bump }} -m "release: %s"
git push --follow-tags

- name: Publish to NPM
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish to NPM (OIDC trusted publishing)
run: |
npm install -g npm@latest # OIDC trusted publishing needs npm >= 11.5.1

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟠 warningnpm install -g npm@latest is unpinned — a new/bad npm release can break (or compromise) the publish step; pin e.g. npm@11.5.1 or npm@^11.5.1.

npm publish
Loading