Skip to content

Publish: Add npm provenance attestations#34936

Merged
JReinhold merged 5 commits into
nextfrom
copilot/bugfixstorybook-provenance-attestations
May 28, 2026
Merged

Publish: Add npm provenance attestations#34936
JReinhold merged 5 commits into
nextfrom
copilot/bugfixstorybook-provenance-attestations

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 27, 2026

Storybook packages published to npm lack provenance attestations, meaning consumers cannot verify which repo/commit/workflow run produced a given tarball, and npm audit signatures has nothing to check against.

Changes

  • scripts/release/publish.ts: Added --provenance flag to the yarn npm publish command used when publishing all workspace packages.

The workflow already had id-token: write permission 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

  • Chores
    • Enhanced package publishing security configuration to improve release authenticity and verification across distribution channels.

Summary by CodeRabbit

  • Chores
    • Updated package publishing process to include additional metadata with published packages across all workspaces.

Review Change Stack

Co-authored-by: JReinhold <5678122+JReinhold@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix missing provenance attestations for Storybook packages Add npm provenance attestations to publish workflow May 27, 2026
Copilot AI requested a review from JReinhold May 27, 2026 16:30
@JReinhold JReinhold added maintenance User-facing maintenance tasks ci:docs Run the CI jobs for documentation checks only. labels May 27, 2026
@JReinhold JReinhold changed the title Add npm provenance attestations to publish workflow Publish: Add npm provenance attestations May 27, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 27, 2026

Fails
🚫 PR description is missing the mandatory "#### Manual testing" section. Please add it so that reviewers know how to manually test your changes.

Generated by 🚫 dangerJS against 8ab3ef6

@JReinhold JReinhold marked this pull request as ready for review May 27, 2026 16:44
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 27, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 92f949bb-1c7c-4839-84e1-357510db3b19

📥 Commits

Reviewing files that changed from the base of the PR and between 4504278 and 8ab3ef6.

📒 Files selected for processing (1)
  • scripts/release/publish.ts

📝 Walkthrough

Walkthrough

The pull request adds the --provenance flag to the npm publish command in the release publish script. This single-line modification enables npm provenance support when publishing all workspace packages, with no other changes to publish configuration or retry behavior.

Changes

NPM Provenance Flag in Publish Script

Layer / File(s) Summary
Add --provenance to npm publish command
scripts/release/publish.ts
The npm publish command is updated to include the --provenance flag when publishing workspace packages, enabling Provenance Statements attestation without modifying other publish arguments or retry logic.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related issues

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between 2221849 and cf9b0ed.

📒 Files selected for processing (1)
  • .github/workflows/publish.yml

Comment thread .github/workflows/publish.yml Outdated
Comment thread .github/workflows/publish.yml Outdated
Comment thread .github/workflows/publish.yml Outdated
Copilot AI requested a review from JReinhold May 28, 2026 05:11
@JReinhold
Copy link
Copy Markdown
Contributor

@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>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 28, 2026

@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.

Added --provenance directly to the yarn npm publish command in scripts/release/publish.ts, and removed the env var from the workflow. See commit
for the change.

@JReinhold
Copy link
Copy Markdown
Contributor

Using the environment variables for some reason didn't make a difference, but adding the --provenance flag to the publish command worked:

image

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.

@JReinhold JReinhold merged commit 896b349 into next May 28, 2026
1 check failed
@JReinhold JReinhold deleted the copilot/bugfixstorybook-provenance-attestations branch May 28, 2026 08:12
@JReinhold JReinhold added the patch:yes Bugfix & documentation PR that need to be picked to main branch label May 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:docs Run the CI jobs for documentation checks only. maintenance User-facing maintenance tasks patch:yes Bugfix & documentation PR that need to be picked to main branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Storybook packages are published to npm without provenance attestations

3 participants