Skip to content

Commit

Permalink
add optional input for github packages auth
Browse files Browse the repository at this point in the history
  • Loading branch information
lukerollans committed Oct 11, 2023
1 parent c5f1a8e commit d81573f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ inputs:
description: Boolean to indicate if the action should automatically cache `node_modules`
required: false
default: true
github-packages-org:
description: Sets up GitHub Packages authentication for the nominated organisation
required: false
default: false

runs:
using: composite
Expand All @@ -28,10 +32,10 @@ runs:
uses: actions/checkout@v3

- name: Configure GitHub Packages authentication
if: ${{ env.GITHUB_TOKEN != '' }}
if: ${{ inputs.github-packages-org != 'false' }}
shell: bash
run: |
echo "//npm.pkg.github.com/:_authToken=${{ env.GITHUB_TOKEN }}" >> .npmrc
echo "//npm.pkg.github.com/${{ inputs.github-packages-org }}:_authToken=${{ env.GITHUB_TOKEN }}" >> .npmrc
- name: Setup pnpm
uses: pnpm/[email protected]
Expand Down

0 comments on commit d81573f

Please sign in to comment.