I am trying to do something very simple: passing a value into a reusable workflow input. I've done this before and it is still working in this very same repo. But whatever new input I add to any workflow, I cannot get any value passed into it.
The reusable workflow has:
on:
workflow_call:
inputs:
branch-to-build:
# do not use branch as name as it will be master in a scheduled run
type: string
description: 'Branch to checkout, build and publish'
required: false
default: 'dev'
tag-to-apply:
type: string
description: 'Tag to apply to the images'
required: false
default: 'nightly-dev'
jobs:
tag:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ github.event.inputs.branch-to-build }}
And then the calling workflow has:
jobs:
nightly-build-dev:
uses: ./.github/workflows/reusable.yml
with:
branch-to-build: 'dev'
tag-to-apply: 'nightly-dev'
secrets: inherit
Now when I kick-off the calling workflow via the GitHub UI, the branch-to-build value is always empty instead of 'dev' which is provided (or 'dev' which is also the default).
What am I missing? I must be overlooking something. Using inputs.branch-to-build
doesn't help.
Opper
I am trying to do something very simple: passing a value into a reusable workflow input. I've done this before and it is still working in this very same repo. But whatever new input I add to any workflow, I cannot get any value passed into it.
The reusable workflow has:
on:
workflow_call:
inputs:
branch-to-build:
# do not use branch as name as it will be master in a scheduled run
type: string
description: 'Branch to checkout, build and publish'
required: false
default: 'dev'
tag-to-apply:
type: string
description: 'Tag to apply to the images'
required: false
default: 'nightly-dev'
jobs:
tag:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ github.event.inputs.branch-to-build }}
And then the calling workflow has:
jobs:
nightly-build-dev:
uses: ./.github/workflows/reusable.yml
with:
branch-to-build: 'dev'
tag-to-apply: 'nightly-dev'
secrets: inherit
Now when I kick-off the calling workflow via the GitHub UI, the branch-to-build value is always empty instead of 'dev' which is provided (or 'dev' which is also the default).
What am I missing? I must be overlooking something. Using inputs.branch-to-build
doesn't help.
Opper
Share Improve this question asked Mar 30 at 21:51 VaalVaal 6927 silver badges12 bronze badges1 Answer
Reset to default 0So the day after it just works with input.branch-to-build