cli: Trigger workflow with default boolean results in error: could not create workflow dispatch event: HTTP 422: Provided value '' for input 'debug' not in the list of allowed values

When triggering a GitHub Actions workflow that supports a default boolean, the CLI fails with the following error:

$ gh workflow run <workflow>
could not create workflow dispatch event: HTTP 422: Provided value '' for input 'debug' not in the list of allowed values (https://api.github.com/repos/HariSekhon/<repo>/actions/workflows/510171/dispatches)

The relevant workflow YAML section is:

on:
  workflow_dispatch:
    inputs:
      debug:
        type: boolean
        required: false
        default: false
$ gh version
gh version 2.5.1 (2022-02-15)
https://github.com/cli/cli/releases/tag/v2.5.1

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 14
  • Comments: 19 (8 by maintainers)

Commits related to this issue

Most upvoted comments

Update: we’re still awaiting a platform fix for this. From what I can see, there is nothing wrong in the inputs payload that GitHub CLI sends (in fact, gh workflow run examples above don’t even specify the value for the optional DEBUG input), but the platform still throws an error.

@BioCarmen No updates in the thread usually means no updates from our end, sorry. Last time I checked, this was still a bug on the platform (it’s known and it’s being tracked internally).

@rainabba Unfortunately, this is still a bug on the platform. The workaround is to always supply values even for optional boolean fields.

This should now be fixed in production. Thank you for your patience.

Is there a public GitHub platform bug tracking this somewhere?

No. The closest we have is the community forum: https://github.com/orgs/community/discussions/categories/api-and-webhooks

Either way, I went ahead and submitted a bug through my enterprise work account over here

Thanks!