Skip to content

Commit 61d16b9

Browse files
committed
chore(ci): use trusted publishing
1 parent f9907f5 commit 61d16b9

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

.github/workflows/CI.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ jobs:
255255
with:
256256
node-version: 24
257257
cache: pnpm
258+
registry-url: 'https://registry.npmjs.org'
258259
- name: Install dependencies
259260
run: pnpm install
260261
- name: create npm dirs
@@ -273,29 +274,24 @@ jobs:
273274
GH_TOKEN: ${{ github.token }}
274275
REPO: ${{ github.repository }}
275276
SHA: ${{ github.event.pull_request.head.sha }}
276-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
277277
run: |
278278
if [ "${{ github.event.pull_request.head.repo.fork }}" = "true" ]
279279
then
280280
echo "Fork PR, skipping publish"
281281
exit 0
282282
fi
283283
284-
npm config set provenance true
285-
286284
MESSAGE="$(gh api "repos/$REPO/commits/$SHA" --jq '.commit.message')"
287285
FIRST_LINE="$(printf '%s' "$MESSAGE" | head -n 1 | tr -d '\r')"
288286
289287
echo "Latest commit: $FIRST_LINE"
290288
291289
if printf '%s' "$FIRST_LINE" | grep -Eq '^[0-9]+\.[0-9]+\.[0-9]+$'
292290
then
293-
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
294-
npm publish --access public
291+
npm publish --provenance --access public
295292
elif printf '%s' "$FIRST_LINE" | grep -Eq '^[0-9]+\.[0-9]+\.[0-9]+'
296293
then
297-
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
298-
npm publish --tag next --access public
294+
npm publish --provenance --tag next --access public
299295
else
300296
echo "Not a release, skipping publish"
301297
fi

0 commit comments

Comments
 (0)