Skip to content

Commit dae8dce

Browse files
authored
Update CI workflow with permissions and node version
Added permissions for id-token and contents, updated node version to 20, and modified npm publish step. Signed-off-by: Joseph Garrone <[email protected]>
1 parent 59d709c commit dae8dce

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

.github/workflows/ci.yaml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ on:
77
branches:
88
- main
99

10+
permissions:
11+
id-token: write
12+
contents: write
13+
1014
jobs:
1115
test_format:
1216
runs-on: ubuntu-latest
@@ -110,8 +114,10 @@ jobs:
110114
ref: ${{ github.ref }}
111115
- uses: actions/setup-node@v5
112116
with:
117+
node-version: '20'
113118
registry-url: https://registry.npmjs.org/
114-
- uses: bahmutov/npm-install@v1
119+
- run: npm install -g npm@latest
120+
- run: yarn install --frozen-lockfile
115121
- run: yarn build --prePublish
116122
- run: npx -y -p [email protected] enable_short_npm_import_path
117123
env:
@@ -125,16 +131,11 @@ jobs:
125131
echo "This version is already published"
126132
exit 0
127133
fi
128-
if [ "$NODE_AUTH_TOKEN" = "" ]; then
129-
echo "Can't publish on NPM, You must first create a secret called NPM_TOKEN that contains your NPM auth token. https://help.github.com/en/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets"
130-
false
131-
fi
132134
EXTRA_ARGS=""
133135
if [ "$IS_PRE_RELEASE" = "true" ]; then
134136
EXTRA_ARGS="--tag next"
135137
fi
136138
npm publish $EXTRA_ARGS
137139
env:
138-
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
139140
VERSION: ${{ needs.check_if_version_upgraded.outputs.to_version }}
140141
IS_PRE_RELEASE: ${{ needs.check_if_version_upgraded.outputs.is_pre_release }}

0 commit comments

Comments
 (0)