Skip to content

Conversation

@GauBen
Copy link
Contributor

@GauBen GauBen commented Dec 15, 2025

What's the problem this PR addresses?

Closes #7017

How did you fix it?

Set provenance = true when all necessary env vars are defined

Checklist

  • I have set the packages that need to be released for my changes to be effective.
  • I will check that all automated PR checks pass before the PR gets reviewed.

Comment on lines 137 to 142
} else if (this.provenance) {
provenance = true;
provenanceMessage = `Generating provenance statement because \`--provenance\` flag is set.`;
} else if (configuration.get(`npmPublishProvenance`)) {
provenance = true;
provenanceMessage = `Generating provenance statement because \`npmPublishProvenance\` setting is set.`;
Copy link
Member

Choose a reason for hiding this comment

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

IMO, if we are to enable provenance by default (even conditionally), we need to properly support --no-provenance and npmPublishProvenance: false to override that behaviour

@Drarig29
Copy link

Hi @GauBen @clemyan! Gentle bump on this PR. While reading https://docs.npmjs.com/trusted-publishers#automatic-provenance-generation we assumed we could drop the --provenance flag when migrating to OIDC publishing with Yarn as well, but it's only the case for NPM.

In the meantime, we are going to reintroduce the --provenance flag

@arcanis
Copy link
Member

arcanis commented Jan 15, 2026

I'm not certain we can do this - it's not documented well, but provenance publishing isn't possible from private repositories :/

https://github.blog/changelog/2023-07-25-publishing-with-npm-provenance-from-private-source-repositories-is-no-longer-supported/

Or at least we may need to replicate a check to make sure we don't apply this on private repo. How does npm do it?

@Drarig29
Copy link

Drarig29 commented Jan 15, 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.

[Feature] Automatically enable provenance when under the right conditions

4 participants