Skip to content

Commit 60b6ce1

Browse files
authored
ci: switch npm auth to OIDC (#4997)
1 parent 04c3236 commit 60b6ce1

1 file changed

Lines changed: 6 additions & 11 deletions

File tree

.github/workflows/make-release.yml

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ name: Make Release
44
#
55
# === Automated activities ===
66
# 1. [Quality check] run unit tests, linting, examples, layer, doc snippets
7-
# 2. [Release] publish all packages to npmjs.org using the latest git commit, ensure provenance with NPM_CONFIG_PROVENANCE=true
7+
# 2. [Release] publish all packages to npmjs.org using the latest git commit using OIDC authentication with automatic provenance attestations
88
# 3. [Create tag] create a new git tag using released version, i.e. v1.13.1
99
# 4. [Publish layer] build and package layer, kick off the workflow for beta and prod deployment, including canary tests
1010
# 5. [Publish layer] update documentation with the latest layer ARN version of the prod deployment
@@ -30,14 +30,14 @@ jobs:
3030
run-unit-tests:
3131
uses: ./.github/workflows/reusable-run-linting-check-and-unit-tests.yml
3232
# This job publishes the packages to npm.
33-
# It uses the latest git commit sha as the version and ensures provenance with NPM_CONFIG_PROVENANCE flag.
33+
# It uses the latest git commit sha as the version and uses OIDC authentication for secure
34+
# and passwordless publishing to npmjs.org with automatic provenance attestations.
3435
# We don't bump the version because we do that in the `make-version` workflow.
3536
# It also sets the RELEASE_VERSION output to be used by the next job to create a git tag.
3637
publish-npm:
3738
needs: run-unit-tests
38-
# Needed as recommended by npm docs on publishing with provenance https://docs.npmjs.com/generating-provenance-statements
3939
permissions:
40-
id-token: write
40+
id-token: write # Needed for OIDC authentication & provenance with npm trusted publishing
4141
environment: Release
4242
runs-on: ubuntu-latest
4343
outputs:
@@ -47,22 +47,17 @@ jobs:
4747
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
4848
with:
4949
ref: ${{ github.sha }}
50-
- name: Setup NodeJS
50+
- name: Setup Node.js
5151
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
5252
with:
5353
node-version: 24
5454
cache: "npm"
5555
registry-url: 'https://registry.npmjs.org'
56-
- name: Setup auth tokens
57-
env:
58-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
59-
run: |
60-
npm set "//registry.npmjs.org/:_authToken=$NPM_TOKEN"
6156
- name: Setup dependencies
6257
uses: aws-powertools/actions/.github/actions/cached-node-modules@29979bc5339bf54f76a11ac36ff67701986bb0f0
6358
- name: Publish to npm
6459
run: |
65-
npm publish --workspaces --provenance
60+
npm publish --workspaces
6661
- name: Set release version
6762
id: set-release-version
6863
run: |

0 commit comments

Comments
 (0)