From c92d619a9ba0e462e6b009d2a6a061e8064c14f3 Mon Sep 17 00:00:00 2001 From: Deepak Tiwari Date: Sat, 5 Aug 2023 18:19:49 +0530 Subject: [PATCH] test tags on branch --- .github/workflows/tag-print.yml | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/.github/workflows/tag-print.yml b/.github/workflows/tag-print.yml index 1583b29..c6acb85 100644 --- a/.github/workflows/tag-print.yml +++ b/.github/workflows/tag-print.yml @@ -15,22 +15,14 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v2 + with: + fetch-depth: 0 - - name: Increment Tag and Create New Tag - id: increment_tag - run: | - latest_tag=${{ github.event.workflow_run.outputs.tag }} - # Extract the numeric part of the tag and increment it - tag_number=$(echo "$latest_tag" | sed 's/v//') - new_tag_number=$((tag_number + 1)) - new_tag="v$new_tag_number" - git tag $new_tag - echo "::set-output name=new_tag::$new_tag" - - - name: Push New Tag + - name: tags + id: tag run: | - new_tag=${{ steps.increment_tag.outputs.new_tag }} - git push origin $new_tag + TAG=$(echo "${{ github.ref }}" | sed -e "s/refs\/tags\///")" + echo "::set-output name=tag::$TAG" build_other_branches: if: github.ref != 'refs/heads/master' @@ -45,9 +37,3 @@ jobs: run: | TAG=$(echo "${{ github.ref }}" | sed -e "s/refs\/tags\///")" echo "::set-output name=tag::$TAG" - - - name: Build and push - env: - TAG: ${{ steps.tag.outputs.TAG }} - run: | - echo "Building Docker image with tag: ${TAG}"