From 582c9d6bce41feb2e9dc5ba45ad1bbff4e7b3c7e Mon Sep 17 00:00:00 2001 From: Stas Date: Fri, 20 Sep 2019 23:12:50 +0300 Subject: [PATCH] Fix problem with DEBUG variable (#435) * Fix problem with DEBUG variable * Add condition for starting ci on pull requests * Add default value * Add default value in another place * Fix error in bash statement * Replace && on if condition --- .github/workflows/blank.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/blank.yml b/.github/workflows/blank.yml index 6c65ca9c..7fb88b16 100644 --- a/.github/workflows/blank.yml +++ b/.github/workflows/blank.yml @@ -4,6 +4,7 @@ on: push: branches: tags: + pull_request: jobs: build: @@ -14,12 +15,21 @@ jobs: run: docker version - name: Debug if needed run: | - [[ "$DEBUG" ]] && env + export DEBUG=${DEBUG:-false} + + if [[ "$DEBUG" == "true" ]]; then + env + fi env: DEBUG: ${{secrets.DEBUG}} - name: Build image run: | export GIT_BRANCH="${GITHUB_REF/refs\/heads\//}" + export GIT_TAG="${GITHUB_REF/refs\/tags\//}" + + if [[ "$GIT_TAG" != "$GITHUB_REF" ]]; then + export GIT_BRANCH=$GIT_TAG + fi docker build \ --build-arg CI="$GITHUB_WORKFLOW" \