Skip to content

Commit 4baf17e

Browse files
Native build job fix (#197)
Summary: Native build job fix Type: Fix Test Plan: CI Jira: ENTDAI-2475
1 parent eb227ca commit 4baf17e

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

.github/workflows/native_build.yml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,24 @@ jobs:
5555
5656
- name: Switch branch
5757
continue-on-error: true
58+
shell: sh +e {0}
5859
run: |
59-
BRANCH=${GITHUB_HEAD_REF##*/}
60+
BRANCH="master"
61+
if [ "$GITHUB_EVENT_NAME" = "pull_request" ]; then
62+
git ls-remote --exit-code --heads "https://github.com/rdkcentral/rialto.git" ${{ github.event.pull_request.head.ref }} > /dev/null
63+
if [ $? -eq 0 ]; then
64+
BRANCH="${{ github.event.pull_request.head.ref }}"
65+
else
66+
git ls-remote --exit-code --heads "https://github.com/rdkcentral/rialto.git" ${{ github.event.pull_request.base.ref}} > /dev/null
67+
if [ $? -eq 0 ]; then
68+
BRANCH="${{ github.event.pull_request.base.ref }}"
69+
else
70+
BRANCH="master"
71+
fi
72+
fi
73+
fi
6074
cd rialto
61-
# This will fail if there's no corresponding branch in rialto
62-
# ...but that's ok since we set continue-on-error
63-
git checkout $BRANCH
75+
git checkout "$BRANCH"
6476
6577
- name: Native build Rialto
6678
run: |

0 commit comments

Comments
 (0)