Skip to content

Commit

Permalink
ci: πŸ’š add Setup npmrc to pnpm setup workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
zhumeisongsong committed Oct 25, 2024
1 parent a713c39 commit be1f489
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/reusable-pnpm-setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
required: false
type: string
default: .
NPM_TOKEN:
required: false
type: string

jobs:
setup:
Expand Down Expand Up @@ -52,6 +55,16 @@ jobs:
restore-keys: |
${{ env.cache-name }}-${{ runner.os }}-
- name: Setup npmrc
if: "${{ inputs.NPM_TOKEN != '' }}"
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
cat << EOF > "$HOME/.npmrc"
//registry.npmjs.org/:_authToken=$NPM_TOKEN
EOF
shell: bash

- name: Install Dependencies
if: ${{ steps.cache-pnpm-store.outputs.cache-hit == 'false' }}
run: pnpm install --frozen-lockfile

0 comments on commit be1f489

Please sign in to comment.