File tree Expand file tree Collapse file tree 1 file changed +16
-4
lines changed
Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Original file line number Diff line number Diff 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 : |
You can’t perform that action at this time.
0 commit comments