Skip to content

Commit

Permalink
Merge branch 'master' into notifyemailchange
Browse files Browse the repository at this point in the history
  • Loading branch information
fbm3307 authored Oct 26, 2023
2 parents 56bf1e7 + 68b24f2 commit efca133
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions make/test.mk
Original file line number Diff line number Diff line change
Expand Up @@ -96,18 +96,17 @@ ifeq ($(E2E_REPO_PATH),"")
git clone https://github.com/codeready-toolchain/toolchain-e2e.git ${E2E_REPO_PATH}
ifneq ($(CI),)
ifneq ($(GITHUB_ACTIONS),)
$(eval BRANCH_REF = refs/heads/${GITHUB_HEAD_REF})
$(eval BRANCH_NAME = ${GITHUB_HEAD_REF})
$(eval AUTHOR_LINK = https://github.com/${AUTHOR})
else
$(eval AUTHOR_LINK = $(shell jq -r '.refs[0].pulls[0].author_link' <<< $${CLONEREFS_OPTIONS} | tr -d '[:space:]'))
@echo "using pull sha ${PULL_PULL_SHA}"
# get branch ref of the fork the PR was created from
$(eval BRANCH_REF := $(shell curl ${AUTHOR_LINK}/member-operator.git/info/refs?service=git-upload-pack --output - /dev/null 2>&1 | grep -a ${PULL_PULL_SHA} | awk '{print $$2}'))
@echo "found author link ${AUTHOR_LINK}"
$(eval BRANCH_NAME := $(shell jq -r '.refs[0].pulls[0].head_ref' <<< $${CLONEREFS_OPTIONS} | tr -d '[:space:]'))
endif
@echo "using author link ${AUTHOR_LINK}"
@echo "detected branch ref ${BRANCH_REF}"
# check if a branch with the same ref exists in the user's fork of toolchain-e2e repo
$(eval REMOTE_E2E_BRANCH := $(shell curl ${AUTHOR_LINK}/toolchain-e2e.git/info/refs?service=git-upload-pack --output - 2>/dev/null | grep -a "${BRANCH_REF}$$" | awk '{print $$2}'))
$(eval REMOTE_E2E_BRANCH := $(shell curl ${AUTHOR_LINK}/toolchain-e2e.git/info/refs?service=git-upload-pack --output - 2>/dev/null | grep -a "refs/heads/${BRANCH_NAME}$$" | awk '{print $$2}'))
@echo "branch ref of the user's fork: \"${REMOTE_E2E_BRANCH}\" - if empty then not found"
# check if the branch with the same name exists, if so then merge it with master and use the merge branch, if not then use master
if [[ -n "${REMOTE_E2E_BRANCH}" ]]; then \
Expand Down

0 comments on commit efca133

Please sign in to comment.