Syntax for getting the repository_dispatch type #26994
-
Roughly what I need is this:
But I can’t figure out the proper incantation to find out what the repository_dispatch type was that triggered my action, and I can’t find it in the documentation anywhere. Any suggestions? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Sure, you can use the property " github.event.action" of the github context to fetch the activity type of the repository_dispatch event. The activity type ( event_type , Required) is a custom webhook event name define in the request body when you run the " Create a repository dispatch event" API. You can set the name as any you like. When using the API to trigger a workflow on the repository_dispatch event, the data you set in the request body will be passed into the github context of the triggered workflow run. The value of " event_type" will be passed to " github.event.action", and " client_payload" will be copied into the github context as a sub-object of " github.event". Related docs: |
Beta Was this translation helpful? Give feedback.
@m-hilgendorf ,
Sure, you can use the property " github.event.action" of the github context to fetch the activity type of the repository_dispatch event.
The activity type ( event_type , Required) is a custom webhook event name define in the request body when you run the " Create a repository dispatch event" API. You can set the name as any you like.
When using the API to trigger a workflow on the repository_dispatch event, the data you set in the request body will be passed into the github context of the triggered workflow run. The value of " event_type" will be passed to " github.event.action", and " client_payload" will be copied into the github context as a sub-object of " github.event".