You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a workflow that responds to workflow_dispatch events like this:
name: fooon:
workflow_dispatch:
inputs:
foo:
description: Example optional boolean input without `default` property.required: falsetype: boolean
This worked fine for running it from the actions page of the repository. I wanted the checkbox to appear on the web UI, so I provided boolean input. This worked perfectly well.
But when I tried to run it from the GitHub API, it failed with the following error:
$ GH_DEBUG=api gh workflow run foo
> POST /repos/r7kamura/sandbox/actions/workflows/████████/dispatches HTTP/1.1
> Host: api.github.com
> Accept: application/vnd.github.merge-info-preview+json, application/vnd.github.nebula-preview
> Authorization: token ████████████████████
> Content-Type: application/json; charset=utf-8
> Time-Zone: Asia/Tokyo
> User-Agent: GitHub CLI 2.14.2
{
"inputs": {},
"ref": "main"
}
...
< HTTP/2.0 422 Unprocessable Entity
< Access-Control-Allow-Origin: *
...
{
"message": "Provided value '' for input 'foo' not in the list of allowed values",
"documentation_url": "https://docs.github.com/rest/reference/actions#create-a-workflow-dispatch-event"
}
* Request took 318.624ms
could not create workflow dispatch event: HTTP 422: Provided value '' for input 'foo' not in the list of allowed values (https://api.github.com/repos/r7kamura/sandbox/actions/workflows/████████/dispatches)
As a workaround, I changed the workflow file like this, and it worked.
name: foo
on:
workflow_dispatch:
inputs:
foo:
+ default: "false"
description: Example optional boolean input without `default` property.
required: false
type: boolean
I'd like this to be handled well on the GitHub API side without having to specify a default String value, what do you think?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have a workflow that responds to
workflow_dispatch
events like this:This worked fine for running it from the actions page of the repository. I wanted the checkbox to appear on the web UI, so I provided boolean input. This worked perfectly well.
But when I tried to run it from the GitHub API, it failed with the following error:
As a workaround, I changed the workflow file like this, and it worked.
name: foo on: workflow_dispatch: inputs: foo: + default: "false" description: Example optional boolean input without `default` property. required: false type: boolean
I'd like this to be handled well on the GitHub API side without having to specify a default String value, what do you think?
Beta Was this translation helpful? Give feedback.
All reactions