Skip to content

Commit 14fe999

Browse files
committed
ci: tag commit after sync on dev branch
1 parent 21e3bdd commit 14fe999

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

.github/workflows/upstream-sync.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)