| 定义 | on: workflow_call(inputs/secrets/outputs) |
|---|---|
| 调用 | uses: org/repo/.github/workflows/x.yml@ref |
| 粒度 | 作业级复用 |
| 嵌套 | 支持层级有限,链路保持简短 |
被调用与调用
被调用与调用
# 被调用方
on:
workflow_call:
inputs:
target: {required: true, type: string}
jobs:
build:
runs-on: ubuntu-latest
steps:
- run: echo "build ${{ inputs.target }}"
# 调用方
# jobs:
# call:
# uses: org/repo/.github/workflows/build.yml@main
# with:
# target: prod复用工作流是作业级复用,复合动作是步骤级复用:按粒度选择。