I am trying to setup a workflow to be triggered via Github Actions' "Repository Dispatch event", as specified here and here. As input to the API request, it specifies that i need to include an event-type, as a custom webhook event name.
I however also want to be able to use this event-type in my workflow, so that i can have multiple workflows triggered by the repository_dispatch
option, each triggered by their own event type.
As specified in the section about how to use webhook event triggers, i have tried using the types field, when declaring when my workflow should trigger (see code). This however only results in nothing being triggered. If i omit the types field, the workflow triggers.
Here is my workflow
name: External trigger
on:
repository_dispatch
types: external_test
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Say hi
run: echo "Hi!"
and here is the API request payload:
{
"event_type": "external_test"
}
Missing a :
after repository_dispatch
so the yaml is not valid.
name: External trigger
on:
repository_dispatch:
types: external_test
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With