New: Trigger pipelines on pull requests

May 9, 2018

New: Trigger pipelines on pull requests

Finally – the most requested feature in the history of Buddy has landed! Following tag push executions, it is now possible to trigger pipelines from single and forked repositories on pull requests. This means that you can now use Buddy’s pipelines to test PRs and give GitHub the green light for merge!

The feature covers two most popular Git workflows:

  • Single-Repo Pull Requests: the whole branching for the PR takes place within one repository
  • Forked Pull Request: the PR goes from a previously forked repository to an upstream repository (GitHub only)

Below you'll find use cases for both.

Single-Repo Pull Requests

To cover pull requests for branches within the same repository, you need a single pipeline that will be executed on every push to every branch:

  1. Add new pipeline and set the Trigger mode to On push.
  2. Select Branches by wildcard as the pipeline trigger
  3. The default command refs/heads/* will run all branches

Adding a new pipelineAdding a new pipeline

Once you create the Pipeline, you can add build and test actions. The actions will be automatically triggered on every push to every branch. The results of the execution will be passed to your Git service, where they can be reviewed for readiness for merging on the corresponding PR page. Here is an example from GitHub:

GitHub pull requests pageGitHub pull requests page

Every pull request has the status of the triggered pipeline execution, like here in GitHub:

Pull request status on GitHubPull request status on GitHub

Forked Pull Requests

If you are using a forked repository to make changes that you want to merge to the upstream, you can create a pipeline that will help you decide if the changes are ready to be accepted.

By default, this feature is turned off. It can be activated by clicking Pull Requests and throwing a switch in the right column of the Pipelines tab.

Forked pull request toggleForked pull request toggle

Once the option is enabled, a new wildcard will become available to use in the pipeline settings: Pull requests by wildcard (refs/pull/*)

Just as with single-repo PRs, the forked PRs also have full integration with Github’s pull requests tab and the pull request activity stream for managing PRs acceptance.

WARNING: If your GitHub repository is public and YAML for Buddy configuration is enabled, turning on forked pull requests in a project may lead to disclosing your sensitive data by exposing environment variables stored in your repo. In this case, it is better to switch back to the GUI mode, or not use public GitHub projects at all.

Need help setting up your Git workflow?

Reach out on the Intercom or drop a word to support@buddy.works with a short description of your process and we'll prepare a working demo for you.

Share:

Alexander Kus

Alexander Kus

Customer Success Manager

A story-teller and conversation-lover, Alexander decided to invest his skills to help his friends at Buddy transform the cold language of patch notes into exciting narratives. Also: an avid gamer, hip-hop DJ, Liverpool FC fan, absentminded husband, and the father of two.