Pull Request pipeline build fails when I merge the Pull Request
Platform Notice: Cloud Only - This article only applies to Atlassian products on the cloud platform.
Summary
My pull request build fails upon merging.
Cause
A pull request build is initiated whenever there is an update on the source branch. This can happen when a commit is made on the source branch or during the creation of the pull request itself. During the build setup, the source branch of the repository is cloned.
This issue arises in a specific rare scenario:
A pull request build is initiated upon the creation of the pull request.
The pull request gets merged right after its creation by utilizing the "Delete Source Branch" feature.
If the merging of the pull request takes place within 10 seconds of its creation, the build process encounters a failure because the source branch is removed before the build system can complete the cloning process.
Solution
To resolve this issue, wait for a few seconds after creating the pull request before merging it. This delay allows the build system enough time to clone the source branch and complete the necessary steps on the cloned source code.
By understanding and implementing this simple timing adjustment, you can ensure that your pull request builds run smoothly and successfully.
Was this helpful?