Skip to content

Commit a321999

Browse files
authored
[bre-1104] update npm publish to use oidc (#415)
## 🎟️ Tracking [bre-1104](https://bitwarden.atlassian.net/browse/bre-1104) ## 📔 Objective npm supports publishing via OIDC, this PR preps the workflow to use OIDC instead. additional changes needed on the npm config side ## 📸 Screenshots <!-- Required for any UI changes; delete if not applicable. Use fixed width images for better display. --> ## ⏰ Reminders before review - Contributor guidelines followed - All formatters and local linters executed and passed - Written new unit and / or integration tests where applicable - Protected functional changes with optionality (feature flags) - Used internationalization (i18n) for all UI strings - CI builds passed - Communicated to DevOps any deployment requirements - Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team ## 🦮 Reviewer guidelines <!-- Suggested interactions but feel free to use (or not) as you desire! --> - 👍 (`:+1:`) or similar for great changes - 📝 (`:memo:`) or ℹ️ (`:information_source:`) for notes or general info - ❓ (`:question:`) for questions - 🤔 (`:thinking:`) or 💭 (`:thought_balloon:`) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion - 🎨 (`:art:`) for suggestions / improvements - ❌ (`:x:`) or ⚠️ (`:warning:`) for more significant problems or concerns needing attention - 🌱 (`:seedling:`) or ♻️ (`:recycle:`) for future improvements or indications of technical debt - ⛏ (`:pick:`) for minor or nitpick changes
1 parent bc28234 commit a321999

File tree

1 file changed

+6
-32
lines changed

1 file changed

+6
-32
lines changed

.github/workflows/publish-wasm-internal.yml

Lines changed: 6 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ jobs:
5858
5959
npm:
6060
name: Publish NPM
61+
environment: NPM
6162
runs-on: ubuntu-24.04
6263
needs: setup
6364
permissions:
@@ -67,27 +68,11 @@ jobs:
6768
- name: Checkout repo
6869
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
6970

70-
- name: Setup Node
71-
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
71+
- name: Set up Node
72+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
7273
with:
73-
node-version: 20
74-
75-
- name: Log in to Azure
76-
uses: bitwarden/gh-actions/azure-login@main
77-
with:
78-
subscription_id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
79-
tenant_id: ${{ secrets.AZURE_TENANT_ID }}
80-
client_id: ${{ secrets.AZURE_CLIENT_ID }}
81-
82-
- name: Retrieve secrets
83-
id: retrieve-secrets
84-
uses: bitwarden/gh-actions/get-keyvault-secrets@main
85-
with:
86-
keyvault: "bitwarden-ci"
87-
secrets: "npm-api-key"
88-
89-
- name: Log out from Azure
90-
uses: bitwarden/gh-actions/azure-logout@main
74+
node-version: 24
75+
registry-url: "https://registry.npmjs.org/"
9176

9277
- name: Download artifact
9378
uses: bitwarden/gh-actions/download-artifacts@main
@@ -102,19 +87,8 @@ jobs:
10287
run: |
10388
npm version --no-git-tag-version $VERSION
10489
env:
105-
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
10690
VERSION: ${{needs.setup.outputs.release-version}}
10791

108-
- name: Setup NPM
109-
run: |
110-
echo 'registry="https://registry.npmjs.org/"' > ./.npmrc
111-
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ./.npmrc
112-
113-
echo 'registry="https://registry.npmjs.org/"' > ~/.npmrc
114-
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
115-
env:
116-
NPM_TOKEN: ${{ steps.retrieve-secrets.outputs.npm-api-key }}
117-
11892
- name: Publish NPM
11993
if: ${{ inputs.release_type != 'Dry Run' }}
120-
run: npm publish --access public --registry=https://registry.npmjs.org/ --userconfig=./.npmrc
94+
run: npm publish --access public

0 commit comments

Comments
 (0)