Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 6 additions & 27 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: 'Setup Node.js environment'
description: 'Setup a Node.js environment by adding problem matchers and optionally downloading and adding it to the PATH.'
author: 'GitHub'
inputs:
registry-auth-token:
description: 'The auth token for package-registry.brightspace.com. Should be set to secrets.D2L_PACKAGE_REGISTRY_AUTH_TOKEN.'
required: true
node-version:
description: 'Version Spec of the version to use. Examples: 12.x, 10.15.1, >=10.15.0.'
node-version-file:
Expand All @@ -11,8 +14,6 @@ inputs:
check-latest:
description: 'Set this option if you want the action to check for the latest available version that satisfies the version spec.'
default: false
registry-url:
description: 'Optional registry to set up for auth. Will set the registry in a project level .npmrc and .yarnrc file, and set up auth to read in from env.NODE_AUTH_TOKEN.'
scope:
description: 'Optional scope for authenticating against scoped registries. Will fall back to the repository owner when using the GitHub Packages registry (https://npm.pkg.github.com/).'
token:
Expand All @@ -29,8 +30,6 @@ inputs:
description: 'Used to specify an alternative mirror to downlooad Node.js binaries from'
mirror-token:
description: 'The token used as Authorization header when fetching from the mirror'
# TODO: add input to control forcing to pull from cloud or dist.
# escape valve for someone having issues or needing the absolute latest which isn't cached yet
outputs:
cache-hit:
description: 'A boolean value to indicate if a cache was hit.'
Expand All @@ -49,33 +48,13 @@ runs:
node-version-file: ${{ inputs.node-version-file }}
architecture: ${{ inputs.architecture }}
check-latest: ${{ inputs.check-latest }}
registry-url: ${{ inputs.registry-url }}
registry-url: https://npm.package-registry.brightspace.com/
scope: ${{ inputs.scope }}
token: ${{ inputs.token }}
cache: ${{ inputs.cache }}
package-manager-cache: ${{ inputs.package-manager-cache }}
cache-dependency-path: ${{ inputs.cache-dependency-path }}
mirror: ${{ inputs.mirror }}
mirror-token: ${{ inputs.mirror-token }}

- uses: Brightspace/third-party-actions@actions/checkout
with:
repository: Brightspace/safe-chain-tmp
path: ./.safe-chain-tmp
sparse-checkout: |
d2l-safe-chain.tgz

- name: Install @d2l/safe-chain
shell: bash
run: |
npm i --global --ignore-scripts ./.safe-chain-tmp/d2l-safe-chain.tgz

- name: Cleanup checkout
shell: bash
run: |
rm -rf ./.safe-chain-tmp

- name: Set Up safe-chain
shell: bash
run: |
safe-chain setup-ci
env:
NODE_AUTH_TOKEN: ${{ inputs.registry-auth-token }}