A Buildkite plugin to check that the commit is "on the branch". More specifically it checks that the commit is an ancestor of what the branch was pointing to at the time of checkout.
Use the plugin in pipline upload step like this:
steps:
- command: buildkite-agent pipeline upload
label: ':pipeline:'
plugins:
- triarius/git-branch-assertion: {}