Skip to content

Commit ec110d2

Browse files
committed
Fix rolling tags workflow to point to correct commit refs - Ensure rolling tags point to the same commit as the release tag - Get commit hash from release tag before creating rolling tags - Add commit hash logging for better debugging - This prevents rolling tags from pointing to different commits
1 parent 8f0ed77 commit ec110d2

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

.github/workflows/update-rolling-tags.yml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,29 +30,33 @@ jobs:
3030
exit 0
3131
fi
3232
33+
# Get the commit hash that the release tag points to
34+
TAG_COMMIT=$(git rev-list -n 1 "$TAG_NAME")
35+
echo "Release tag $TAG_NAME points to commit: $TAG_COMMIT"
36+
3337
# Extract version components
3438
VERSION=${TAG_NAME#v} # Remove 'v' prefix
3539
IFS='.' read -r MAJOR MINOR PATCH <<< "$VERSION"
3640
3741
echo "Version components: MAJOR=$MAJOR, MINOR=$MINOR, PATCH=$PATCH"
3842
39-
# Create/update major version tag (e.g., v0)
43+
# Create/update major version tag (e.g., v0) pointing to the same commit
4044
MAJOR_TAG="v$MAJOR"
41-
echo "Updating major tag: $MAJOR_TAG"
42-
git tag -fa "$MAJOR_TAG" -m "Rolling tag for major version $MAJOR (currently $TAG_NAME)"
45+
echo "Updating major tag: $MAJOR_TAG -> $TAG_COMMIT"
46+
git tag -fa "$MAJOR_TAG" "$TAG_COMMIT" -m "Rolling tag for major version $MAJOR (currently $TAG_NAME)"
4347
44-
# Create/update minor version tag (e.g., v0.7)
48+
# Create/update minor version tag (e.g., v0.7) pointing to the same commit
4549
MINOR_TAG="v$MAJOR.$MINOR"
46-
echo "Updating minor tag: $MINOR_TAG"
47-
git tag -fa "$MINOR_TAG" -m "Rolling tag for minor version $MAJOR.$MINOR (currently $TAG_NAME)"
50+
echo "Updating minor tag: $MINOR_TAG -> $TAG_COMMIT"
51+
git tag -fa "$MINOR_TAG" "$TAG_COMMIT" -m "Rolling tag for minor version $MAJOR.$MINOR (currently $TAG_NAME)"
4852
4953
# Push the updated tags
5054
git push origin "$MAJOR_TAG" --force
5155
git push origin "$MINOR_TAG" --force
5256
5357
echo "Successfully updated rolling tags:"
54-
echo " $MAJOR_TAG -> $TAG_NAME"
55-
echo " $MINOR_TAG -> $TAG_NAME"
58+
echo " $MAJOR_TAG -> $TAG_NAME (commit: $TAG_COMMIT)"
59+
echo " $MINOR_TAG -> $TAG_NAME (commit: $TAG_COMMIT)"
5660
5761
- name: Summary
5862
run: |

0 commit comments

Comments
 (0)