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
Try the following:
name: HelloWorld
on:
workflow_dispatch:
jobs:
checkout:
uses: org/repo/.github/workflows/build.yml@main
with:
jdk_version: 11
And then at the beginning of build.yml, you can do
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
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 can't be nested. A workflow bundles a bunch of actions.
You have to convert your workflows/build.yml into an actions/build.yml and then that action can be used for individual steps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With