Skip to content

Commit f14dd37

Browse files
authored
refactor: introduce trusted publishing (#789)
* refactor: introduced trusted publishing * Update publish-npm.sh * Update 03-publish-packages.yml * Update 03-publish-packages.yml * Update 03-publish-packages.yml * Update 03-publish-packages.yml * Add permissions for contents in release workflow * Update permissions in release workflow Change permissions to allow write access for id-token. * Update 03-publish-packages.yml * Update .nvmrc * Update release.yml * Remove provenance flag from npm publish command
1 parent d6b76e8 commit f14dd37

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

.github/scripts/publish-npm.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,11 @@ do
3939
echo "🔑 Authenticated with GITHUB"
4040
elif [[ $REGISTRY == 'NPM' ]]; then
4141
npm config set @db-ui:registry https://registry.npmjs.org/
42-
npm set //registry.npmjs.org/:_authToken "$NPM_TOKEN"
4342
echo "🔑 Authenticated with NPM"
4443
else
4544
echo "Could not authenticate with $REGISTRY"
4645
exit 1
4746
fi
4847
# https://docs.npmjs.com/generating-provenance-statements#example-github-actions-workflow
49-
npm publish --tag "$TAG" db-ui-base-"$VALID_SEMVER_VERSION".tgz --provenance
48+
npm publish --tag "$TAG" db-ui-base-"$VALID_SEMVER_VERSION".tgz
5049
done

.github/workflows/03-publish-packages.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ jobs:
4848
PRE_RELEASE: ${{ inputs.preRelease }}
4949
VALID_SEMVER_VERSION: ${{ inputs.version }}
5050
GITHUB_COMMITISH: ${{ github.event.release.target_commitish }}
51-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
5251
GPR_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5352

5453
- name: ⬆ Upload Package Artifact db-ui-base

.github/workflows/release.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ jobs:
4040
uses: ./.github/workflows/03-publish-packages.yml
4141
needs: [lint, build, get-publish-version]
4242
secrets: inherit
43+
permissions:
44+
id-token: write # Required for OIDC
4345
with:
4446
release: ${{ needs.get-publish-version.outputs.release }}
4547
preRelease: ${{ needs.get-publish-version.outputs.preRelease }}

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
22
1+
24

0 commit comments

Comments
 (0)