Skip to content

Commit 554ea58

Browse files
mfranzkenmergetCopilot
authored
refactor: prepared trusted publishing (#5279)
* refactor: Remove NPM_TOKEN from `publish-npm.js` Removed NPM_TOKEN usage for authentication in publish script, as we'd like to switch to trusted publishing. * Remove NPM_TOKEN from publish workflow * Update scripts/github/publish-npm.js Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Nicolas Merget <104347736+nmerget@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 9546fbc commit 554ea58

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,3 @@ jobs:
4343
RELEASE: ${{ inputs.release }}
4444
PRE_RELEASE: ${{ inputs.preRelease }}
4545
VALID_SEMVER_VERSION: ${{ inputs.version }}
46-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

scripts/github/publish-npm.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env node
22
import { execSync } from 'node:child_process';
33

4-
const { VALID_SEMVER_VERSION, NPM_TOKEN } = process.env;
4+
const { VALID_SEMVER_VERSION } = process.env;
55
const RELEASE = process.env.RELEASE === 'true';
66
const PRE_RELEASE = process.env.PRE_RELEASE === 'true';
77

@@ -80,8 +80,7 @@ for (const REGISTRY of registries) {
8080

8181
if (REGISTRY === 'NPM') {
8282
execSync('npm config set @db-ux:registry https://registry.npmjs.org/');
83-
execSync(`npm set //registry.npmjs.org/:_authToken ${NPM_TOKEN}`);
84-
console.log('🔑 Authenticated with NPM');
83+
console.log('🔑 Using trusted publishing for NPM');
8584
} else {
8685
console.error(`Could not authenticate with ${REGISTRY}`);
8786
process.exit(1);

0 commit comments

Comments
 (0)