可重用的工作流程应在顶级“jobs.*.uses”中引用。关键,不在步骤之内
可重用的工作流程应在顶级“jobs.*.uses”键中引用,而不是在步骤中引用
name: HelloWorld
on:
workflow_dispatch:
jobs:
checkout:
runs-on: windows-latest
steps:
- name: Checkout using the Template File
uses: actions/checkout@v2
- name: Compile Java
uses: org/repo/.github/workflows/build.yml@main
with:
jdk_version: 11
错误:.github#L1 可重用的工作流程应在顶级“jobs.*.uses”键处引用,而不是在步骤内引用
reusable workflows should be referenced at the top-level `jobs.*.uses' key, not within steps
name: HelloWorld
on:
workflow_dispatch:
jobs:
checkout:
runs-on: windows-latest
steps:
- name: Checkout using the Template File
uses: actions/checkout@v2
- name: Compile Java
uses: org/repo/.github/workflows/build.yml@main
with:
jdk_version: 11
Error: .github#L1
reusable workflows should be referenced at the top-level `jobs.*.uses' key, not within steps
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试以下操作:
然后在 build.yml 的开头,您可以执行以下
操作 无论出于何种原因,可重用工作流程不能位于
steps
内,因此您必须在顶层使用它并执行您正在调用的工作流程中的所有配置/其他步骤。Try the following:
And then at the beginning of build.yml, you can do
For whatever reason reusable workflows can't be inside
steps
, so you have to just use it at the top-level and do all your configuration/other steps inside the workflow you're calling.工作流程不能嵌套。工作流程捆绑了一系列操作。
您必须将
workflows/build.yml
转换为actions/build.yml
,然后该操作可以用于各个步骤。Workflows can't be nested. A workflow bundles a bunch of actions.
You have to convert your
workflows/build.yml
into anactions/build.yml
and then that action can be used for individual steps.