Skip to content

Commit 9447f60

Browse files
Fixed GitHub Actions CI build for pull requests, second attempt taking repository into account. (#522)
Signed-off-by: RICCIARDI-Adrien <[email protected]>
1 parent 940fa28 commit 9447f60

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

.github/workflows/build.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,16 @@ jobs:
1414
- name: Configure build machine
1515
run: |
1616
apt update
17-
apt install -y -q apt-transport-https curl git kmod software-properties-common sudo wget
17+
apt install -y -q apt-transport-https curl git software-properties-common sudo wget
1818
# The keyboard-configuration package is needed later and requires the user to input a number via dpkg-reconfigure, so preinstall it without front-end to avoid blocking the later installations
1919
DEBIAN_FRONTEND=noninteractive apt install -y -q keyboard-configuration
2020
- name: Checkout sources
2121
run: |
2222
# 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
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 .
23+
# Retrieve the correct repository and branch names according to the build event (push or pull_request)
24+
if [ -z "${{ github.head_ref }}" ]; then BRANCH=${{ github.ref_name }}; REPOSITORY=${{ github.repository }}; else BRANCH=${{ github.head_ref }}; REPOSITORY=${{ github.event.pull_request.head.repo.full_name }}; fi
25+
echo "Cloning branch $BRANCH from repository $REPOSITORY..."
26+
git clone --depth=1 https://github.com/$REPOSITORY --branch=$BRANCH .
2727
- name: Environment tests
2828
run: ./tests/tests-environment.sh
2929
- name: CI tests

0 commit comments

Comments
 (0)