Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Fix branch matching for build steps
Browse files Browse the repository at this point in the history
  • Loading branch information
turt2live committed Jan 6, 2022
1 parent 6102a6e commit f92707c
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions scripts/fetchdep.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,18 @@ elif [ -n "$REVIEW_ID" ]; then
getPRInfo $REVIEW_ID
fi

# $head will always be in the format "fork:branch", so we split it by ":" into
# an array. The first element will then be the fork and the second the branch.
# Based on that we clone
# for forks, $head will be in teh format "fork:branch", so we split it by ":"
# into an array. On non-forks, this has the effect of splitting into a single
# element array given ":" shouldn't appear in the head - it'll just be the
# branch name. Based on the results, we clone.
BRANCH_ARRAY=(${head//:/ })
clone ${BRANCH_ARRAY[0]} $defrepo ${BRANCH_ARRAY[1]}
TRY_ORG=$deforg
TRY_BRANCH=${BRANCH_ARRAY[0]}
if [[ "$head" == *":"* ]]; then
TRY_ORG=${BRANCH_ARRAY[0]}
TRY_BRANCH=${BRANCH_ARRAY[1]}
fi
clone ${TRY_ORG} $defrepo ${TRY_BRANCH}

# Try the target branch of the push or PR.
if [ -n $GITHUB_BASE_REF ]; then
Expand Down

0 comments on commit f92707c

Please sign in to comment.