Skip to content

Commit 1fd1adb

Browse files
committed
feat: support corepack and provenance
1 parent 69d95b8 commit 1fd1adb

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

.github/actions/setup/action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ runs:
2424
with:
2525
node-version: ${{ inputs.node-version }}
2626

27+
- name: Enable Corepack
28+
shell: bash
29+
run: corepack enable
30+
2731
- name: Check Yarn Version
2832
id: yarn-version
2933
shell: bash

.github/workflows/publish.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ on:
1414
required: false
1515
secrets:
1616
NPM_TOKEN:
17-
required: true
17+
required: false
1818
description: 'NPM token'
1919

2020
jobs:
@@ -33,8 +33,16 @@ jobs:
3333
- name: Build
3434
run: yarn build
3535

36+
- name: Set Publish Config
37+
id: set-token
38+
if: '!secrets.NPM_TOKEN'
39+
run: |
40+
yarn config set npmPublishProvenance true
41+
yarn config set npmRegistryServer https://registry.npmjs.org/
42+
3643
- name: Set NPM Token
3744
id: set-token
45+
if: secrets.NPM_TOKEN
3846
# Solution for NPM (as well as Yarn v1)
3947
run: |
4048
# Create a temporary directory for putting the .npmrc file

0 commit comments

Comments
 (0)