test/diff-manifest: fetch base branch from GitHub
Distro version branches aren't synced to GitLab, so we will need to fetch them from GitHub directly. This is required for any PR made against any branch other than main.
This commit is contained in:
parent
05503c58c2
commit
c88d0255da
1 changed files with 9 additions and 3 deletions
|
|
@ -31,12 +31,18 @@ basebranch=$(curl \
|
|||
-H 'Accept: application/vnd.github.v3+json' \
|
||||
"https://api.github.com/repos/osbuild/osbuild-composer/pulls/${prnum}" | jq -r ".base.ref")
|
||||
|
||||
greenprint "Fetching origin/${basebranch}"
|
||||
git fetch origin "${basebranch}"
|
||||
greenprint "Adding upstream GitHub remote"
|
||||
# distro version branches aren't synced to GitLab, so we will need to fetch
|
||||
# them from GitHub directly
|
||||
git remote add gh https://github.com/osbuild/osbuild-composer
|
||||
git remote show gh
|
||||
|
||||
greenprint "Fetching gh/${basebranch}"
|
||||
git fetch gh "${basebranch}"
|
||||
|
||||
greenprint "Getting revision IDs for HEAD and merge-base"
|
||||
head=$(git rev-parse HEAD)
|
||||
mergebase=$(git merge-base HEAD "origin/${basebranch}")
|
||||
mergebase=$(git merge-base HEAD "gh/${basebranch}")
|
||||
|
||||
if [[ "${head}" == "${mergebase}" ]]; then
|
||||
greenprint "HEAD and merge-base are the same"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue