Step 1
Use a secret-backed .npmrc
Write the scoped registry line and token line before dependency install. The workflow can keep the package manager command normal after that.
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
- run: |
echo "@acme:registry=https://registry.packagepass.dev/npm/" >> .npmrc
echo "//registry.packagepass.dev/npm/:_authToken=${PACKAGEPASS_INSTALL_TOKEN}" >> .npmrc
echo "always-auth=true" >> .npmrc
env:
PACKAGEPASS_INSTALL_TOKEN: ${{ secrets.PACKAGEPASS_INSTALL_TOKEN }}
- run: npm ci