Guy*_*den 5 github npm yarnpkg github-actions
我目前的工作流程:
name: Node CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10.x]
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: npm install, build, and test
run: |
npm install yarn -g
yarn
yarn test
env:
CI: true
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
Run Code Online (Sandbox Code Playgroud)
我已经NPM_TOKEN在 repo secrets 区域设置了我的。
该令牌也在 Netlify 上使用,并且 netlify 构建过程有效。
当此工作流运行时,我的任何私有包都会收到 404。
我究竟做错了什么?
找到了修复方法:
.npmrc作为作业的一部分编写,而不是依赖环境变量。
name: Node CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10.x]
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: npm install, build, and test
run: |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc
npm install yarn -g
yarn
yarn test
env:
CI: true
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3861 次 |
| 最近记录: |