user2719051
user2719051

Reputation: 11

Azure PR Build gets invalidated when the version file is committed in the build pipeline

I am trying to create an Azure DevOps build pipeline. I have a script in the build pipeline that bumps up the version number, updates the version.h file and commits that file to the git repo. But as soon as this file is committed, the PR shows "Build Not Run":

enter image description here

I am using [skip ci] tag in the beginning of the commit message but doesn't resolve the problem either. I also tried adding "!/version.h; /*" as filters in the branch build policy. It still didn't make any difference. I have been trying to find solutions on google for a few days but it doesn't look like there are a lot of help posts related to this.

How can I make the Pull Request ignore the latest commit pushed from the build pipeline?

Upvotes: 1

Views: 546

Answers (1)

DavidCox88
DavidCox88

Reputation: 1018

At a guess from the image I think this build is being triggered due to the branch policy of having build validation since it sates required check not yet run. Can you check the Build validation policy for this branch and check the build expiration. At a guess this is set to immediately, so when your build pipeline runs and updates the code it immediately invalidates the build validation. If this is the case adding the Path filter on the build validation to exclude the files you are updating should fix the problem

Upvotes: 0

Related Questions