File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -153,16 +153,19 @@ jobs:
153153 fi
154154
155155 echo "PR merged successfully!"
156+
157+ git fetch origin dev
158+ git checkout dev
156159
157160 # Create tag using master branch commit count
158161 TAG_NAME="b$COMMIT_COUNT"
159162
160- # Check if tag exists
161- if git rev-parse " $TAG_NAME" >/dev/null 2>&1 ; then
162- echo "Tag $TAG_NAME already exists"
163+ # Check if tag exists on dev branch
164+ if git ls-remote --tags origin refs/tags/ $TAG_NAME | grep -q refs/tags/$TAG_NAME ; then
165+ echo "Tag $TAG_NAME already exists on dev branch "
163166 else
164- # Create tag on the current commit (master branch HEAD)
167+ # Create tag on the current commit (dev branch HEAD after merge )
165168 git tag "$TAG_NAME"
166169 git push origin "$TAG_NAME"
167- echo "Tag $TAG_NAME created successfully (total commits: $COMMIT_COUNT)"
170+ echo "Tag $TAG_NAME created successfully (total commits from master : $COMMIT_COUNT)"
168171 fi
You can’t perform that action at this time.
0 commit comments