From b6fa6c245dbfbc18cc74a387111a52de9b05d1f4 Mon Sep 17 00:00:00 2001 From: Sylvain <35365065+sanderegg@users.noreply.github.com> Date: Thu, 7 Apr 2022 16:03:56 +0200 Subject: [PATCH] properly get branch name (#2970) --- .github/workflows/ci-release.yml | 6 +++--- .github/workflows/ci-staging.yml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci-release.yml b/.github/workflows/ci-release.yml index a6d9c5ad4ce..f632fd163ea 100644 --- a/.github/workflows/ci-release.yml +++ b/.github/workflows/ci-release.yml @@ -34,7 +34,7 @@ jobs: fetch-depth: 0 - name: find branch name shell: bash - run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/} | tr / -)" >> $GITHUB_ENV + run: echo "BRANCH_NAME=$(git name-rev --refs="refs/remotes/origin/master" --refs="refs/remotes/origin/hotfix_v*" --refs="refs/remotes/origin/hotfix_staging_*" --name-only ${GITHUB_SHA})" >> $GITHUB_ENV - name: setup docker buildx id: buildx @@ -51,12 +51,12 @@ jobs: - name: show system environs if: github.event_name == 'push' run: ./ci/helpers/show_system_versions.bash - - if: contains(env.BRANCH_NAME, 'master') + - if: contains(env.BRANCH_NAME, 'remotes/origin/master') env: FROM_TAG_PREFIX: staging-github name: deploy run: ./ci/deploy/dockerhub-tag-version.bash - - if: contains(env.BRANCH_NAME, 'hotfix_v') + - if: contains(env.BRANCH_NAME, 'remotes/origin/hotfix_v') env: FROM_TAG_PREFIX: hotfix-github name: deploy from hotfix image diff --git a/.github/workflows/ci-staging.yml b/.github/workflows/ci-staging.yml index bb1f705d4e8..080f022f653 100644 --- a/.github/workflows/ci-staging.yml +++ b/.github/workflows/ci-staging.yml @@ -33,7 +33,7 @@ jobs: fetch-depth: 0 - name: find branch name shell: bash - run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/} | tr / -)" >> $GITHUB_ENV + run: echo "BRANCH_NAME=$(git name-rev --refs="refs/remotes/origin/master" --refs="refs/remotes/origin/hotfix_v*" --refs="refs/remotes/origin/hotfix_staging_*" --name-only ${GITHUB_SHA})" >> $GITHUB_ENV - name: setup docker buildx id: buildx @@ -50,12 +50,12 @@ jobs: - name: show system environs if: github.event_name == 'push' run: ./ci/helpers/show_system_versions.bash - - if: contains(env.BRANCH_NAME, 'master') + - if: contains(env.BRANCH_NAME, 'remotes/origin/master') env: FROM_TAG_PREFIX: master-github name: deploy from master to staging run: ./ci/deploy/dockerhub-tag-version.bash - - if: contains(env.BRANCH_NAME, 'hotfix_staging_') + - if: contains(env.BRANCH_NAME, 'remotes/origin/hotfix_staging_') env: FROM_TAG_PREFIX: hotfix-staging-github name: deploy from hotfix staging to staging