Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

clone PR branch of another repo during pipeline

Ekaterina Khrabrykh January 19, 2022

We have 2 bitbucket repositories, one of the repo (call it A) takes modules from another repo (B). We are developing both repositories at the same time. I want to add running unit tests for PR of project A. But I don't know how to check if there is PR in repo B. And if it exists, how to clone PR branch of repo B. 


My buggy solution is to take feature_branch if it exists, if not to take develop branch of repo B:

- b_repo_branch=${BITBUCKET_BRANCH}
- if [ -z $(git ls-remote ${B_REPO_URL} ${b_repo_branch}) ]; then b_repo_branch="develop"; fi
- git clone --branch ${b_repo_branch} ${B_REPO_URL}
- python3 -m pytest tests/

but it doesn't work when develop branches of both repos already have  some crucial changes and there are no merging conflicts (PR is possible)

Do you know how to know about pull requests of another repo during pipeline? 

1 answer

0 votes
Igor Stoyanov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 21, 2022

@Ekaterina Khrabrykh hi. Thanks for your question.
For pull requests try to use Bitbucket API Pull requests 

Regards, Igor.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events