Skip to content

Commit ec8d899

Browse files
authored
Merge pull request #3905 from semantic-release/alpha
2 parents bcbf055 + c770748 commit ec8d899

File tree

4 files changed

+83
-10
lines changed

4 files changed

+83
-10
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ name: Release
55
- master
66
- next
77
- beta
8+
- alpha
89
- "*.x"
910
permissions:
1011
contents: read # for checkout

docs/recipes/ci-configurations/github-actions.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,16 @@ The [Authentication](../../usage/ci-configuration.md#authentication) environment
66

77
In this example a publish type [`NPM_TOKEN`](https://docs.npmjs.com/creating-and-viewing-authentication-tokens) is required to publish a package to the npm registry. GitHub Actions [automatically populate](https://docs.github.com/en/actions/security-guides/automatic-token-authentication) a [`GITHUB_TOKEN`](https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-line) environment variable which can be used in Workflows.
88

9-
## npm provenance
9+
## Trusted publishing and npm provenance
1010

11-
Since GitHub Actions is a [supported provider](https://docs.npmjs.com/generating-provenance-statements#provenance-limitations) for [npm provenance](https://docs.npmjs.com/generating-provenance-statements), it is recommended to enable this to increase supply-chain security for your npm packages.
12-
Find more detail about configuring npm to publish with provenance through semantic-release [in the documentation for our npm plugin](https://github.com/semantic-release/npm#npm-provenance).
11+
For improved security and automation, it is recommended to leverage [trusted publishing](https://docs.npmjs.com/trusted-publishers) through [OpenID Connect (OIDC)](https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect) when publishing to npm from GitHub Actions.
12+
GitHub Actions is a [trusted identity provider](https://docs.npmjs.com/trusted-publishers#identity-providers) for npm, enabling configuration of a trust relationship between your GitHub repository and npm so that no long-lived secret (like an `NPM_TOKEN`) is required to publish packages to npm from GitHub Actions.
13+
The npm registry [recently increased restrictions for use of long-lived access tokens](https://github.blog/changelog/2025-09-29-strengthening-npm-security-important-changes-to-authentication-and-token-management/), further encouraging trusted publishing as the preferred approach for publishing to npm from GitHub Actions.
14+
Enabling trusted publishing requires granting the `id-token: write` permission to the job performing the publish step and [configuring a trust relationship](https://docs.npmjs.com/trusted-publishers#step-1-add-a-trusted-publisher-on-npmjscom) between your GitHub repository and npm.
15+
16+
[npm provenance](https://docs.npmjs.com/generating-provenance-statements) is valuable for increasing supply-chain security for your npm packages.
17+
Before trusted publishing was available, generating provenance attestations required configuring your project to enable publishing with provenance.
18+
With trusted publishing, npm provenance is automatically generated for packages published to npm from GitHub Actions without any additional configuration.
1319

1420
## Node project configuration
1521

@@ -40,7 +46,7 @@ jobs:
4046
contents: write # to be able to publish a GitHub release
4147
issues: write # to be able to comment on released issues
4248
pull-requests: write # to be able to comment on released pull requests
43-
id-token: write # to enable use of OIDC for npm provenance
49+
id-token: write # to enable use of OIDC for trusted publishing and npm provenance
4450
steps:
4551
- name: Checkout
4652
uses: actions/checkout@v4
@@ -57,7 +63,6 @@ jobs:
5763
- name: Release
5864
env:
5965
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
60-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
6166
run: npx semantic-release
6267
```
6368

package-lock.json

Lines changed: 71 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"@semantic-release/commit-analyzer": "^13.0.1",
3131
"@semantic-release/error": "^4.0.0",
3232
"@semantic-release/github": "^12.0.0",
33-
"@semantic-release/npm": "^13.0.0",
33+
"@semantic-release/npm": "^13.1.0-beta.1",
3434
"@semantic-release/release-notes-generator": "^14.1.0",
3535
"aggregate-error": "^5.0.0",
3636
"cosmiconfig": "^9.0.0",

0 commit comments

Comments
 (0)