From 824bffadcc477acde3dac58b000f69957016e3e0 Mon Sep 17 00:00:00 2001 From: Jack Ivanov Date: Thu, 16 Jan 2020 11:02:40 +0100 Subject: [PATCH] Github Actions fix for PRs --- .github/workflows/main.yml | 2 ++ tests/pre-deploy.sh | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3b9d885..457f6dd 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -68,6 +68,8 @@ jobs: env: DEPLOY: cloud-init UBUNTU_VERSION: ${{ matrix.UBUNTU_VERSION }} + REPOSITORY: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name || github.repository }} + BRANCH: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || github.ref }} run: | ssh-keygen -f ~/.ssh/id_rsa -t rsa -N '' # sed -i "s/^reduce_mtu:\s0$/reduce_mtu: 80/" config.cfg diff --git a/tests/pre-deploy.sh b/tests/pre-deploy.sh index dc51008..e6cee52 100755 --- a/tests/pre-deploy.sh +++ b/tests/pre-deploy.sh @@ -8,8 +8,8 @@ tar xf $HOME/lxc/cache.tar -C / || echo "Didn't extract cache." cp -f tests/lxd-bridge /etc/default/lxd-bridge cp -f tests/algo.conf /etc/default/algo.conf -export REPOSITORY=${GITHUB_REPOSITORY} -export BRANCH=${GITHUB_REF#refs/heads/} +export REPOSITORY=${REPOSITORY:-${GITHUB_REPOSITORY}} +export BRANCH=${BRANCH:-${GITHUB_REF#refs/heads/}} if [[ "$DEPLOY" == "cloud-init" ]]; then bash tests/cloud-init.sh | lxc profile set default user.user-data -