From 2048bc60f7b3ec2581a21414d2e28ec3ec647cd5 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Tue, 17 Dec 2019 12:30:20 +0100 Subject: [PATCH] WIP: Update GH Actions --- .github/workflows/cicd.yml | 4 ++-- docker/build.sh | 10 +++++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 54747e55af..5e1e5aa6bb 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest container: ultimaker/cura-build-environment steps: - - name: Checkout code - uses: actions/checkout@v1.2.0 + - name: Checkout Cura + uses: actions/checkout@v2 - name: Build and test run: docker/build.sh diff --git a/docker/build.sh b/docker/build.sh index eb20b18c0d..4510692bf2 100755 --- a/docker/build.sh +++ b/docker/build.sh @@ -20,7 +20,15 @@ cd "${PROJECT_DIR}" # Check the branch to use: # 1. Use the Uranium branch with the branch same if it exists. # 2. Otherwise, use the default branch name "master" -URANIUM_BRANCH="${CI_COMMIT_REF_NAME:-master}" +echo "GITHUB_REF: ${GITHUB_REF}" +echo "GITHUB_BASE_REF: ${GITHUB_BASE_REF}" + +GIT_REF_NAME="${GITHUB_REF}" +if [ -n "${GITHUB_BASE_REF}" ]; then + GIT_REF_NAME="${GITHUB_BASE_REF}" +fi + +URANIUM_BRANCH="${GIT_REF_NAME:-master}" output="$(git ls-remote --heads https://github.com/Ultimaker/Uranium.git "${URANIUM_BRANCH}")" if [ -z "${output}" ]; then echo "Could not find Uranium banch ${URANIUM_BRANCH}, fallback to use master."