I have a mono repo. It includes a private package. The problem I am having is with my github actions pipeline. I can download the private library to run tests on one of my projects in the runner. However, when I attempt to execute a CDK later in the pipeline following similar steps, it doesn’t find the module.
What is confusing me, is the error message isn’t what you would normally see if the NODE_AUTH_TOKEN wasn’t applied correctly. The runner appears to download the module during npm i, but then can’t seem to find it at run time.
I am sure I am missing something obvious.
Here is the CDK action I am expecting to be able to deploy CDK.
name: "Deploy with CDK"
description: "CDK Actions"
inputs:
deploy_path:
required: true
description: ""
REPOSITORY_AWS_ACCOUNT:
required: true
description: ""
REPOSITORY_NPM_TOKEN:
required: true
description: ""
AWS_REGION:
required: true
description: ""
AWS_ACCESS_KEY_ID:
required: true
description: ""
AWS_SECRET_ACCESS_KEY:
required: true
description: ""
runs:
using: "composite"
steps:
- uses: actions/checkout@v4
name: Check Out Repository
- name: Install Node and register NPM
uses: actions/setup-node@v4
with:
node-version: "20.x"
registry-url: "https://registry.npmjs.org"
scope: "@bice.macarron"
env:
NODE_AUTH_TOKEN: ${{ inputs.REPOSITORY_NPM_TOKEN }}
- name: Install CDK
run: npm i -g aws-cdk
env:
NODE_AUTH_TOKEN: ${{ inputs.REPOSITORY_NPM_TOKEN }}
shell: bash
- name: Install Packages
run: npm i
env:
NODE_AUTH_TOKEN: ${{ inputs.REPOSITORY_NPM_TOKEN }}
shell: bash
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@master
with:
aws-access-key-id: ${{ inputs.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ inputs.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ inputs.AWS_REGION }}
- name: Deploy with CDK
shell: bash
run: npm run cdk:deploy -w=${{ inputs.deploy_path }}
Error message is here:
Monorepo structure:
.gitignore
.github
/workflows
/actions
node_modules
package.json
src
/@bice.macarron/bar-library
/bar-infrastructure