Publish: Add npm provenance attestations#34936
Conversation
Co-authored-by: JReinhold <5678122+JReinhold@users.noreply.github.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe pull request adds the ChangesNPM Provenance Flag in Publish Script
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Possibly related issues
✨ Finishing Touches📝 Generate docstrings
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/publish.yml:
- Line 109: The publish workflow sets NPM_CONFIG_PROVENANCE but Yarn requires
YARN_NPM_CONFIG_PROVENANCE (or npmPublishProvenance in .yarnrc.yml) when running
yarn ... npm publish; update the environment variable in
.github/workflows/publish.yml (replace NPM_CONFIG_PROVENANCE: true with
YARN_NPM_CONFIG_PROVENANCE: true at both occurrences) or alternatively set
npmPublishProvenance in .yarnrc.yml or export YARN_NPM_CONFIG_PROVENANCE before
invoking the script referenced by scripts/release/publish.ts so Yarn actually
enables provenance during publish.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 2c37fd67-d6f7-45e1-a6b4-ab566c2006b7
📒 Files selected for processing (1)
.github/workflows/publish.yml
|
@copilot this didn't work for some reason, there is still not provenance on the published package. try adding the CLI flag instead, to the place where we call the publish CLI command. |
Co-authored-by: JReinhold <5678122+JReinhold@users.noreply.github.com>
Added |
|
Using the environment variables for some reason didn't make a difference, but adding the
https://www.npmjs.com/package/storybook/v/0.0.0-pr-34936-sha-8ab3ef66#provenance This has the side-effect that trying to publish from local is very likely going to fail, because you can't do provenance from a local computer. But that's okay, we don't have a scenario where a local publish is necessary today. Even security backports are being released from GH Actions today. |

Storybook packages published to npm lack provenance attestations, meaning consumers cannot verify which repo/commit/workflow run produced a given tarball, and
npm audit signatureshas nothing to check against.Changes
scripts/release/publish.ts: Added--provenanceflag to theyarn npm publishcommand used when publishing all workspace packages.The workflow already had
id-token: writepermission for OIDC, so this flag is the only missing piece. Going forward, each published package will include a signed provenance statement linking it to the source commit and workflow run.Summary by CodeRabbit
Summary by CodeRabbit