benc-uk / workflow-dispatch

A GitHub Action for triggering workflows, using the `workflow_dispatch` event
MIT License
327 stars 125 forks source link

Add support for client_payload #71

Closed jeppevinkel closed 6 months ago

jeppevinkel commented 6 months ago

The workflow dispatch endpoint also supports taking in a client_payload object in the request body with values. This object can have a more complex structure than what the inputs supports.

An example usage could be a payload like this

"client_payload": {
  "release": {
    "name": "some-name"
  }
}

This can be used in the workflow with the following syntax

${{ github.event.client_payload.release.name }}
jeppevinkel commented 6 months ago

Disregard my momentary stupidity. I have remembered wrong. The client_payload is only supported in the repository_dispatch api, which otherwise does nearly the same as workflow_dispatch.