Accept custom refs other than tags and branches in workflow dispatch API

I’m building a webhook system to trigger GitHub Actions workflows through Gerrit events, to perform code check against an open change in Gerrit, for example. However, when triggering a GitHub workflow using the workflow dispatch API and passing the ref information for the Gerrit change, GitHub refuses the request saying that the reference does not exist (while it’s not true).



Authorization: Basic felipecrs:<hidden>
Content-Type: application/json

    "ref": "refs/changes/35/514035/3"


422 Unprocessable Entity

  "message": "No ref found for: refs/changes/35/514035/3",
  "documentation_url": ""

However, the reference does exist in GitHub:

❯ git fetch refs/changes/35/514035/3
 * branch            refs/changes/35/514035/3 -> FETCH_HEAD

I believe GitHub tolerate Gerrit refs but does not really support them.
We (Gerrit project) replicate all changes to but I’ve noticed that even though they aren’t fully discoverable.

One possibility could be performing a mapping of refs when pushed to a replication endpoint, so that refs/changes/* could be remapped to refs/heads/changes/*. What do you think?

I think a solution like this can be considered, as there isn’t any forecast of GitHub accepting such feature request.

See this other one, very related: Github Action: trigger on a custom references, not branches or tags - #8 by shrink

It has been more than 6 months and there isn’t even an official response from GitHub staff.