Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot trigger dispatches from GitHub API

I want to trigger a GitHub Actions workflow manually. Through the docs I found out I can do so through a repository dispatch event.

The problem is that when I hit the API at the /dispatches endpoint, I get the following error:

{
    "message": "Not Found",
    "documentation_url": "https://developer.github.com/v3/repos/#create-a-repository-dispatch-event"
}

I have write access to the repo. I generated myself an access token.

Is the dispatches functionality enabled by default or do I need to "enable" it somehow, so the the /dispatches endpoint becomes available? Either I didn't look well enough, or this is not described in the docs.

I don't know if it makes a difference, but the repo is owned by an organization, not by an individual user.

like image 420
Milkncookiez Avatar asked Apr 26 '26 05:04

Milkncookiez


1 Answers

The problem turned out to be very basic. I was sending the Authorization header with Bearer prefix, before the actual token, whereas I was supposed to send it with token prefix.

Needless to say, the returned error message is quite misleading.

like image 161
Milkncookiez Avatar answered Apr 29 '26 01:04

Milkncookiez