Skip to content

GitHub webhooks

In the repository’s settings add a webhook: the URL and secret from the project’s settings page, content type application/json, and the push and pull_request events. A project with no secret, or a server with no secrets key, takes no delivery. The secret is at least 16 characters.

  • A push to a branch starts the pipelines whose on.push it matches, at the commit that was pushed. Tags and deleted branches start nothing.
  • A pull request starts those whose on.pull_request it matches, at its head, by the base repository’s refs/pull/<n>/head. opened, synchronize and reopened unless types says otherwise.
  • branches are whole names: of the push, or the base of the pull request.
  • paths of a pull request are asked of GitHub with the project’s GITHUB_TOKEN secret, which needs to read pull requests. Without it, or when GitHub does not answer in time, a pipeline filtered by path is not started, and the delivery says so. A push too large to list its files starts.
  • The commit is used by pipelines that check out the repository the delivery is of. Others run as they would by hand.

A pull request from a fork, or whose origin is not known, is untrusted: no secrets, only runners that take such steps, and nothing it starts cancels what others started. All such runs together may use a fifth of each limit of open runs and of runs in an hour. Files of at most 20 such pull requests an hour are asked for; a pipeline filtered by path does not start for more.

The same delivery sent again is the same run, for a week or until the run is erased if that is sooner. GitHub shows a delivery red when nothing it was for could be started: send it again once what its answer names is fixed. A delivery starts at most 20 runs; the rest of a project’s pipelines do not start for it.

A pipeline that its delivery matches and that does not compile is recorded as a failed run, which says why: once for a delivery and what is wrong. Sent again once that is fixed, it starts. A delivery that started a run before its pipeline was broken, and is sent again while it is, is recorded as failed too, and its commit’s status says so until another run of it.

Branches of the repository itself are trusted, whoever made them: those of Dependabot and of a merge queue too.

Anyone can send a request. One with a wrong signature costs a read of the database and a body of at most 4 MiB. A Worker instance holds at most 24 MiB of bodies not verified yet, 8 MiB of one address, each read for at most 10 seconds, and takes 600 requests a minute of one address. Beyond that deliveries are refused with 429 or 503: someone who keeps sending from a few addresses, or through GitHub’s own, can delay yours while they do. Send those again from GitHub’s list.

A run of a fork is cancelled when no runner has taken one of its steps for FIBER_UNTRUSTED_QUEUE_HOURS (24; 0 is never, on fiber-engine). Until then it keeps its place in the fifth, and an author who keeps sending pull requests can take it again. Waiting behind a busy runner counts. A changed setting applies to runs started after it. A pipeline of more than 1000 steps or 50 sets of labels is more than the fifth, and does not start for a fork.

The fifth for runs of forks is one: re-runs of them by members, and other projects of the same creator, use it too. Their steps also wait in line with the rest for runners that take untrusted steps.

A run of a delivery’s commit says pending, then success, failure, or error when it was cancelled, on that commit as fiber/<pipeline>. The pipeline’s workspace must be on github.com, and the project needs a GITHUB_TOKEN secret (or FIBER_GITHUB_TOKEN) that may write commit statuses. Runs started by hand or by a schedule have no commit, and say nothing. Set FIBER_PUBLIC_URL on the engine, an https:// address, for a link to the run.

The newest run of a commit counts, also of pipelines of one name. What a fork’s run says never replaces what the project’s own run said of the same commit, for 30 days after that. Runs of forks change one commit’s status at most 50 times, and at most 100 are sent for them in an hour. GitHub is asked up to 8 times over about two hours when it fails; when it refuses, as for a token without the right, it is not asked again until the run’s next state. A project that GitHub limits waits as long as it says, at most an hour at a time; what could not be sent in a day is not sent.