File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 4949
5050 - name : Clone & Build knowhow-common dependency
5151 run : |
52- git clone --branch ${{ github.event.pull_request.base.ref }} https://github.com/PublicisSapient/knowhow-common.git
52+ SOURCE_BRANCH="${{ github.head_ref }}"
53+ TARGET_BRANCH="${{ github.event.pull_request.base.ref }}"
54+
55+ echo "Checking if branch '$SOURCE_BRANCH' exists in knowhow-common repo..."
56+ if git ls-remote --heads https://github.com/PublicisSapient/knowhow-common.git $SOURCE_BRANCH | grep $SOURCE_BRANCH; then
57+ BRANCH_TO_CLONE=$SOURCE_BRANCH
58+ else
59+ echo "Branch '$SOURCE_BRANCH' not found. Falling back to target branch '$TARGET_BRANCH'."
60+ BRANCH_TO_CLONE=$TARGET_BRANCH
61+ fi
62+
63+ git clone --branch $BRANCH_TO_CLONE https://github.com/PublicisSapient/knowhow-common.git
5364 cd knowhow-common
5465 mvn clean install -Ddockerfile.skip=true -X
5566
You can’t perform that action at this time.
0 commit comments