【发布时间】:2022-11-08 22:31:48
【问题描述】:
我使用可重用的工作流,然后执行它抛出工作流
模板.yml:
name: Reusable workflow
on:
workflow_call:
inputs:
jobName:
required: true
type: string
jobDependencies:
required: true
type: string
jobs:
deployNotebook:
name: Deployment ${{ inputs.jobName }} env
runs-on: ubuntu-latest
needs: ${{ inputs.jobDependencies }}
steps:
- name: Deployment of Job
run: echo Hello world
工作流.yml:
name: Workflow which use Template
on:
workflow_dispatch:
jobs:
validation:
name: Workflow validation
runs-on: ubuntu-latest
steps:
- name: Deployment of Notebook
shell: pwsh
run: Write-Host 'Workflow successfully parsed'
dev:
uses: ./.github/workflows/Template.yml
with:
jobName: 'dev'
jobDependencies: 'validation'
test:
uses: ./.github/workflows/Template.yml
with:
jobName: 'test'
jobDependencies: 'dev'
当我运行它时,我收到错误:
无法识别的命名值:“输入”。位于表达式中的位置 1:inputs.jobDependencies
同时 ${{ inputs.job Name }} 工作正常。 如果我注释掉 ${{ inputs.job Dependencies }} 一切正常。
如何使用 jobs.<job_id>.needs 与外部提供的输入?
【问题讨论】:
标签: github input yaml github-actions