Skip to content

Commit

Permalink
test tags on branch
Browse files Browse the repository at this point in the history
  • Loading branch information
Deepak Tiwari committed Aug 5, 2023
1 parent d63b9f6 commit c92d619
Showing 1 changed file with 6 additions and 20 deletions.
26 changes: 6 additions & 20 deletions .github/workflows/tag-print.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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}"

0 comments on commit c92d619

Please sign in to comment.