我有多个相互依赖的工作流程。第一个工作流程将生成一些 ID 或编号,相关工作流程将读取这些 ID 或编号。
流动:
第一个工作流程(generated number
)手动触发-->第一个工作流程执行后将触发第二个工作流程(需要generated number
)-->第二个工作流程执行后将触发第三个工作流程(需要generated number
)
工作流程1.yml
name: First workflow
on:
workflow_dispatch:
jobs:
some_job:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Generate some number
run: ${{ github.run_number }}
# How to save/store this number?
工作流程2.yml
name: Second workflow
on:
workflow_run:
workflows: ["First workflow"]
types:
- completed
jobs:
deploy:
runs-on: ubuntu-latest
steps:
# How do we get the generated number in the First workflow?
工作流程3.yml
name: Third workflow
on:
workflow_run:
workflows: ["Second workflow"]
types:
- completed
jobs:
deploy:
runs-on: ubuntu-latest
steps:
# How do we get the generated number in the First workflow?