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?
@Ekaterina Khrabrykh hi. Thanks for your question.
For pull requests try to use Bitbucket API Pull requests
Regards, Igor.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.