Skip to content

Commit b132205

Browse files
committed
feat(ci): add github token for NPM private packages
1 parent 39dc7f5 commit b132205

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

.github/actions/install/action.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1-
name: '🔒 setup'
1+
name: '🛠️ Install'
22
description: 'Setup Node, pnpm & install dependencies'
33

4+
inputs:
5+
token:
6+
description: Auth Token for GitHub Packages
7+
48
runs:
59
using: 'composite'
610
steps:
@@ -15,6 +19,12 @@ runs:
1519
node-version-file: package.json
1620
cache: pnpm
1721

22+
- name: GitHub Packages Auth
23+
shell: bash
24+
if: ${{ inputs.token != '' }}
25+
run: |
26+
echo "//npm.pkg.github.com/:_authToken=${{ inputs.token }}" >> ~/.npmrc
27+
1828
- name: Install dependencies
1929
shell: bash
20-
run: pnpm install
30+
run: pnpm install --frozen-lockfile

.github/workflows/publish-npm.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ jobs:
4242

4343
- name: Install
4444
uses: ./.github/actions/install
45+
with:
46+
token: ${{ secrets.GITHUB_TOKEN }}
4547

4648
- name: Build
4749
run: pnpm build

.github/workflows/verify.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ jobs:
2424

2525
- name: Install
2626
uses: ./.github/actions/install
27+
with:
28+
token: ${{ secrets.GITHUB_TOKEN }}
2729

2830
- name: Lint
2931
run: pnpm lint
@@ -35,6 +37,8 @@ jobs:
3537

3638
- name: Install
3739
uses: ./.github/actions/install
40+
with:
41+
token: ${{ secrets.GITHUB_TOKEN }}
3842

3943
- name: Build
4044
run: pnpm build
@@ -46,6 +50,8 @@ jobs:
4650

4751
- name: Install
4852
uses: ./.github/actions/install
53+
with:
54+
token: ${{ secrets.GITHUB_TOKEN }}
4955

5056
- name: Build package/playground
5157
uses: docker/build-push-action@v5

0 commit comments

Comments
 (0)