Skip to content

Commit 940fa28

Browse files
Fixed GitHub Actions CI build for pull requests. (#521)
Signed-off-by: RICCIARDI-Adrien <adrien.ricciardi@hotmail.fr>
1 parent 13a32e4 commit 940fa28

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

.github/workflows/build.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ jobs:
99
env:
1010
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1111
TRAVIS_BUILD_NUMBER: ${{ github.run_number }}
12-
BRANCH: ${{ github.ref_name }}
1312
VERSION: continuous
1413
steps:
1514
- name: Configure build machine
@@ -21,7 +20,10 @@ jobs:
2120
- name: Checkout sources
2221
run: |
2322
# Can't use actions/checkout@v2 action here because Ubuntu 16.04 git version is too old, so the action downloads an archive instead of a git repository, and this prevents linuxdeployqt from finding the commit it is built from
24-
git clone --depth=1 https://github.com/${{ github.repository }} --branch=${{ github.ref_name }} .
23+
# Retrieve the correct branch name according to the build event (push or pull_request)
24+
if [ -z "${{ github.head_ref }}" ]; then BRANCH=${{ github.ref_name }}; else BRANCH=${{ github.head_ref }}; fi
25+
echo "Cloning from branch $BRANCH..."
26+
git clone --depth=1 https://github.com/${{ github.repository }} --branch=$BRANCH .
2527
- name: Environment tests
2628
run: ./tests/tests-environment.sh
2729
- name: CI tests

0 commit comments

Comments
 (0)