Type of github.event.inputs.<name>
of boolean inputs in workflow_dispatch
event
#29796
-
Hi, I'm author of actionlint and I got an issue which I suspect a bug of GitHub Actions. So I'd like to clarify this behavior is intended or not. Let's say we have the reusable workflow: name: _reusable
on:
workflow_call:
inputs:
is-valid:
required: true
description: username to show
type: boolean
jobs:
reusable_workflow_job:
runs-on: ubuntu-latest
steps:
- name: called is-valid
run: echo "called is-valid. ${{ inputs.is-valid }}" and a regular workflow: name: actionlint issue
on:
workflow_dispatch:
inputs:
is-valid:
required: true
description: "is-valid: true or false"
type: boolean
jobs:
issue:
uses: ./.github/workflows/_reusable.yaml
with:
is-valid: ${{ github.event.inputs.is-valid }} This causes an error on running them on GitHub:
The If it is not a bug, is type of Currently converting the value to boolean with
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
I only found some semi official statements of some GitHub employees.
Yes, booleans are always strings in that context. GitHub fixed this with unified inputs by providing the is-valid: ${{ inputs.is-valid }} References / Further reading:
I'm the author of https://github.com/ChristopherHX/runner.server an GitHub Actions Emulator, with reusable workflow support so I collected some information about internal working of GitHub Actions |
Beta Was this translation helpful? Give feedback.
-
@rhysd this is the first time I've heard of actionlint, and I just want to say thank you. This is the validator that GH Workflows has been needing for four (almost five?) years. I will be using it frequently. |
Beta Was this translation helpful? Give feedback.
-
I am still facing a similar issue:
when the workflow runs, it prints
it seems the input is unset, even tough its default to |
Beta Was this translation helpful? Give feedback.
I only found some semi official statements of some GitHub employees.
Yes, booleans are always strings in that context.
GitHub fixed this with unified inputs by providing the
inputs
context toworkflow_dispatch
You can now do the following in GitHub Actions, boolean type is only respected for the
inputs
context in both reusable workflow and workflow_dispatchReferences / Further reading: