Skip to content

Trusted publishing#5072

Open
JoviDeCroock wants to merge 3 commits intov10.xfrom
oidc-publishing
Open

Trusted publishing#5072
JoviDeCroock wants to merge 3 commits intov10.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

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