New: Trigger pipelines on pull requests

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

Image loading...Adding 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:

Image loading...GitHub pull requests page

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

Image loading...Pull 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.

Image loading...Forked 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.

Jarek Dylewski

Jarek Dylewski

Customer Support

A journalist and an SEO specialist trying to find himself in the unforgiving world of coders. Gamer, a non-fiction literature fan and obsessive carnivore. Jarek uses his talents to convert the programming lingo into a cohesive and approachable narration.

May 9th 2018
Share