From 2b95ec607c861bffdf4b4654f727ed1f133c79b0 Mon Sep 17 00:00:00 2001 From: Alexey Pustovalov Date: Mon, 18 Oct 2021 19:12:43 +0300 Subject: [PATCH] Fixed tag generation for releases --- .github/workflows/images_build.yml | 17 +++++++++++++++-- .github/workflows/images_build_windows.yml | 17 +++++++++++++++-- 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/.github/workflows/images_build.yml b/.github/workflows/images_build.yml index d5f678a39..c95b28f01 100644 --- a/.github/workflows/images_build.yml +++ b/.github/workflows/images_build.yml @@ -34,7 +34,7 @@ jobs: os: ${{ steps.os.outputs.list }} database: ${{ steps.database.outputs.list }} components: ${{ steps.components.outputs.list }} - current_branch: ${{ steps.branch_info.outputs.current_branch }} + is_default_branch: ${{ steps.branch_info.outputs.is_default_branch }} steps: - name: Checkout repository uses: actions/checkout@v2.3.4 @@ -79,7 +79,20 @@ jobs: - name: Get branch info id: branch_info - uses: tj-actions/branch-names@v5 + run: | + github_ref="{{ github.ref }}" + result=false + + if [[ "$github_ref" == "refs/tags/"* ]]; then + github_ref=${github_ref%.*} + fi + + github_ref=${github_ref##*/} + + if [[ "$github_ref" == "{{ env.LATEST_BRANCH }}" ]]; then + result=true + fi + echo "::set-output name=is_default_branch::$result" build_base: timeout-minutes: 70 diff --git a/.github/workflows/images_build_windows.yml b/.github/workflows/images_build_windows.yml index 3897e56fe..e7d229dd5 100644 --- a/.github/workflows/images_build_windows.yml +++ b/.github/workflows/images_build_windows.yml @@ -34,7 +34,7 @@ jobs: outputs: os: ${{ steps.os.outputs.list }} components: ${{ steps.components.outputs.list }} - current_branch_branch: ${{ steps.branch_info.outputs.current_branch }} + is_default_branch: ${{ steps.branch_info.outputs.is_default_branch }} steps: - name: Checkout repository uses: actions/checkout@v2.3.4 @@ -68,7 +68,20 @@ jobs: - name: Get branch info id: branch_info - uses: tj-actions/branch-names@v5 + run: | + github_ref="{{ github.ref }}" + result=false + + if [[ "$github_ref" == "refs/tags/"* ]]; then + github_ref=${github_ref%.*} + fi + + github_ref=${github_ref##*/} + + if [[ "$github_ref" == "{{ env.LATEST_BRANCH }}" ]]; then + result=true + fi + echo "::set-output name=is_default_branch::$result" build_base: timeout-minutes: 70