2
% gh workflow run test.yml

gives me:

could not create workflow dispatch event: HTTP 422: Workflow does not have 'workflow_dispatch' trigger (https://api.github.com/repos/bcpitutor/v2_lms/actions/workflows/20724896/dispatches)

Why do I need a workflow_dispatch trigger?

zendevil.eth
  • 974
  • 2
  • 9
  • 28
  • This is the way to allow the workflow to be run manually: ["To run a workflow manually, the workflow must be configured to run on the `workflow_dispatch` event."](https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow) – Matt Mar 16 '22 at 16:09

1 Answers1

1

The gh workflow run man page does confirm:

The given workflow file must support a workflow_dispatch 'on' trigger in order to be run in this way.

It comes from cli/cli issue 1725, and issue 2889, implemented by PR 3303.

This PR implements gh workflow run, a command for creating workflow_dispatch events for workflows that support them

Again, a confirmation your workflow needs to support that workflow_dispatch trigger.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250