From 5195ae166acccee6410d626be0d70d44f55fac02 Mon Sep 17 00:00:00 2001 From: Martine Lenders Date: Thu, 17 Dec 2020 13:19:07 +0100 Subject: [PATCH] static-test: use base reference as base branch instead of master This way they will also work with release branches ;-). --- .github/workflows/static-test.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/static-test.yml b/.github/workflows/static-test.yml index 4529dc39dc..f4c00ef294 100644 --- a/.github/workflows/static-test.yml +++ b/.github/workflows/static-test.yml @@ -21,15 +21,19 @@ jobs: fetch-depth: 0 - name: Setup git run: | - git fetch origin master:master_upstream --no-tags + # Note: ${{ github.base_ref }} is empty when not in a PR + if [ -n "${{ github.base_ref }}" ]; then + git fetch origin ${{ github.base_ref }}:${{ github.base_ref }} --no-tags + fi git config apply.whitespace nowarn - name: Fetch riot/riotbuild Docker image run: docker pull riot/riotbuild:latest - name: Run static-tests run: | - docker run --rm \ - -e CI_BASE_BRANCH=master_upstream \ - -e GITHUB_RUN_ID=${GITHUB_RUN_ID} \ - -v $(pwd):/data/riotbuild \ - riot/riotbuild:latest \ + # Note: ${{ github.base_ref }} is empty when not in a PR + docker run --rm \ + -e CI_BASE_BRANCH=${{ github.base_ref }} \ + -e GITHUB_RUN_ID=${GITHUB_RUN_ID} \ + -v $(pwd):/data/riotbuild \ + riot/riotbuild:latest \ make static-test