我有一个带有两个工作流程的monorepo:
.github/workflows/test.yml
name: test
on: [push, pull_request]
jobs:
test-packages:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: test packages
run: |
yarn install
yarn test
...
.github/workflows/deploy.yml
deploy-packages:
runs-on: ubuntu-latest
needs: test-packages
steps:
- uses: actions/checkout@v1
- name: deploy packages
run: |
yarn deploy
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
...
这行不通,我无法在另一个工作流程中引用作业:
### ERRORED 19:13:07Z
- Your workflow file was invalid: The pipeline is not valid. The pipeline must contain at least one job with no dependencies.
有没有一种方法可以在工作流程之间创建依赖关系?
我想要的是test.yml
然后deploy.yml
在标签上运行,并且test.yml
仅在推和拉请求上运行。我不想在工作流之间重复作业。