Manually triggering a Buildkite pipeline for a fork

If you're building on Buildkite, sometimes you may encounter a time where you're contributing from a fork, but CI isn't running (often by design).

So how do you get your build to start running, without pushing it to a branch instead?

If you don't have access to the ability to click the New Build button in the Buildkite UI, you're unfortunately out of luck!

However if you do have the ability to trigger a build, then we can take advantage of the way that GitHub prepares a Git ref (more info) for each Pull Request, which means we can now trigger a build of the given PR.

I.e. if we had PR 12, we'd trigger a build of refs/pull/12/head:

A screenshot of the "New Build" dialog in Buildkite, showing the "Branch" set to refs/pull/12/head, indicating the HEAD of PR 12 on the repo, and leaving the "Commit" as the default HEAD

Thanks to my colleague Isaac for the tip!

Written by Jamie Tanna's profile image Jamie Tanna on , and last updated on .

Content for this article is shared under the terms of the Creative Commons Attribution Non Commercial Share Alike 4.0 International, and code is shared under the Apache License 2.0.

#blogumentation #buildkite.

This post was filed under articles.

Interactions with this post

Interactions with this post

Below you can find the interactions that this page has had using WebMention.

Have you written a response to this post? Let me know the URL:

Do you not have a website set up with WebMention capabilities? You can use Comment Parade.