Skip to content

Trusted publishing#5072

Merged
JoviDeCroock merged 3 commits into
v10.xfrom
oidc-publishing
May 12, 2026
Merged

Trusted publishing#5072
JoviDeCroock merged 3 commits into
v10.xfrom
oidc-publishing

Conversation

@JoviDeCroock
Copy link
Copy Markdown
Member

Summary

  • Adds a publish job to the release workflow that publishes to npm with provenance using OIDC
  • Derives the npm dist-tag from the git tag (prerelease identifier or latest)
  • Adds publishConfig with provenance: true and access: "public" to package.json
  • Uses id-token: write permission for provenance attestation

Security hardening

In addition to the new publish job, this PR nails down some loose ends in the existing workflow:

  • Trigger scoped to on: push: tags: ['10.*'] instead of on: create, which fired for both tags and branches. This also restricts to 10.x version tags only.
  • Potential script injection fixed in the release job — ${{ steps.create-release.outputs.result }} was interpolated directly into a script: block. Now passed via RELEASE_DATA env var and parsed with JSON.parse.
  • All actions pinned to commit SHAs instead of mutable major version tags, preventing supply-chain attacks via tag mutation.
  • Explicit permissions on all jobs — release declares contents: write, publish declares contents: read + id-token: write.

Open question

Setup required

  • On npmjs.com, link the package to the preactjs/preact GitHub repo for provenance verification

Copy link
Copy Markdown
Member

@marvinhagemeister marvinhagemeister left a comment

Choose a reason for hiding this comment

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

LGTM

@JoviDeCroock JoviDeCroock merged commit 3a01255 into v10.x May 12, 2026
4 checks passed
@JoviDeCroock JoviDeCroock deleted the oidc-publishing branch May 12, 2026 05:55
@JoviDeCroock JoviDeCroock mentioned this pull request May 17, 2026
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