0

GitHub creates a new ref when a pull request is created. The ref points to a merge commit, which is the merged code between the source and target branches of the pull request. The PR validation pipeline builds the commit this ref points to. (from here)

This causes a problem for my pipeline with Chromatic: these commits are problematic for a bunch of reasons. The biggest one is as they don't exist in the git history, we lose track of baseline acceptances you do on them.

Is there a way to configure GitHub and/or Azure DevOps build pipeline to trigger build for PR but for normal linear commit in PR branch, not merge of it with target branch?

irriss
  • 742
  • 2
  • 11
  • 22
  • How about the issue? Does the answer below resolved your question, If not, would you please let me know the latest information about this issue? – Leo Liu Jun 01 '21 at 09:54

1 Answers1

0

Is there a way to configure GitHub and/or Azure DevOps build pipeline to trigger build for PR but for normal linear commit in PR branch, not merge of it with target branch?

I am afraid there is no such way to trigger build for PR but for normal linear commit in PR branch.

Just like what you pointed, PR validation pipeline is used to build the merged code between the source and target branches.

If you do not want to build the code merge of it with target branch, you can just set the build pipeline with CI trigger enable for the source branch instead of the PR build for the PR validation pipeline.

Leo Liu
  • 71,098
  • 10
  • 114
  • 135
  • Yes, that's I surely can do. The disadvantage though is that it will trigger build for branches without opened PR yet. Is there a way to filter out branches without PR in YAML? – irriss Jun 09 '21 at 02:07
  • another issue is that github comment "/azp run" now returns "No pipelines are associated with this pull request." despite the fact that build triggers when there is a new commit in the branch – irriss Jun 09 '21 at 02:28