Skip to content

Tharushan/github-actions-webhook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Github actions webhook trigger

Trigger a github action on a simple POST request like this curl :

curl -XPOST -u "[username]:[token]" \
  -H "Accept: application/vnd.github.everest-preview+json" \
  -H "Content-Type: application/json" \
  https://api.github.com/repos/[username]/[repo]/dispatches \
  --data '{"event_type": "[your-event-type]"}'

Setup

You will have to replace some of the values in your CURL requests :

Key Value
token Your Github personal access token (Create personal token with repo rights, there is a tutorial).
username Your Github username
repo Your Github repo where you will trigger the github action
your-event-type Your event-type used in your workflow yml

Here's an example for this repo to trigger the github action:

curl -XPOST -u "Tharushan:ghp_fACErabYlsBdFNMdjIUhTvBjwxIjMVtvDCsF" \
  -H "Accept: application/vnd.github.everest-preview+json" \
  -H "Content-Type: application/json" \
  https://api.github.com/repos/Tharushan/github-actions-webhook/dispatches \
  --data '{"event_type": "webhook-trigger"}'

About

Trigger github action using webhook

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published