fix: packages w/ both provenance + trusted publishing -> trustedPublisher#1302
fix: packages w/ both provenance + trusted publishing -> trustedPublisher#1302
Conversation
…ked as trustedPublisher resolves #1292
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
📝 WalkthroughWalkthroughThis pull request adjusts the trust level evaluation logic for npm packages. The getTrustLevel function now prioritises trustedPublisher status over attestations when determining package trust classification. When a package has both trustedPublisher and attestations, it is now classified as 'trustedPublisher' rather than 'provenance'. A comment is added documenting that trusted publishing automatically generates provenance attestations. Documentation references are updated to point to current npm docs URLs. Test cases are updated to reflect the new classification behaviour and validate that no trust downgrade is incorrectly flagged when both versions have trustedPublisher status with attestations. 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 Comment |
|
|
||
| function getTrustLevel(version: PackumentVersion): PublishTrustLevel { | ||
| if (hasAttestations(version)) return 'provenance' | ||
| // trusted publishing automatically generates provenance attestations |
There was a problem hiding this comment.
This isn’t necessarily true.
For eslint-formatter-gitlab:
| Version | Provenance | Trusted publishing |
|---|---|---|
| 7.0.1 | ✓ | ✓ |
| 7.0.0 | ✓ | |
| 5.0.0 - 6.0.1 | ✓ | |
| 1.0.0 - 4.0.0 |
For GitLab, this adds provenance:
id_tokens:
SIGSTORE_ID_TOKEN:
aud: sigstoreAnd this is needed for trusted publishing:
id_tokens:
NPM_ID_TOKEN:
aud: npm:registry.npmjs.orgFor GitHub this is a bit harder to mess up.
There was a problem hiding this comment.
I was aware but thought that, regardless, trusted publishing was a stronger trust signal
resolves #1292