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