Skip to content

Conversation

rgerganov
Copy link
Collaborator

When releasing a docker image for build number X, we should also create the corresponding git tag. This allows users to easily checkout the corresponding source tree for given docker image.

@github-actions github-actions bot added the devops improvements to build systems and github actions label Sep 15, 2025
@rgerganov rgerganov requested a review from Copilot September 15, 2025 12:53
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds automatic git tag creation for released Docker images. The purpose is to allow users to easily checkout the corresponding source code for any given Docker image by providing a git tag that matches the Docker image tag.

Key changes:

  • Refactors tag determination logic to use a reusable action for generating source tag names
  • Adds a step to create and push git tags when Docker images are published

Comment on lines +180 to +198
git tag ${{ steps.srctag.outputs.name }} || exit 0
git push origin ${{ steps.srctag.outputs.name }} || exit 0
Copy link
Preview

Copilot AI Sep 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using || exit 0 to suppress errors masks legitimate failures. Consider using conditional logic to handle expected vs unexpected errors, or at minimum add logging to indicate when tag creation is skipped due to existing tags.

Suggested change
git tag ${{ steps.srctag.outputs.name }} || exit 0
git push origin ${{ steps.srctag.outputs.name }} || exit 0
if git tag "${{ steps.srctag.outputs.name }}"; then
echo "Tag '${{ steps.srctag.outputs.name }}' created successfully."
else
TAG_ERR=$(git tag "${{ steps.srctag.outputs.name }}" 2>&1 || true)
if echo "$TAG_ERR" | grep -q "already exists"; then
echo "Tag '${{ steps.srctag.outputs.name }}' already exists. Skipping tag creation."
else
echo "Failed to create tag '${{ steps.srctag.outputs.name }}': $TAG_ERR"
exit 1
fi
fi
if git push origin "${{ steps.srctag.outputs.name }}"; then
echo "Tag '${{ steps.srctag.outputs.name }}' pushed successfully."
else
PUSH_ERR=$(git push origin "${{ steps.srctag.outputs.name }}" 2>&1 || true)
if echo "$PUSH_ERR" | grep -q "already exists"; then
echo "Tag '${{ steps.srctag.outputs.name }}' already exists on remote. Skipping push."
else
echo "Failed to push tag '${{ steps.srctag.outputs.name }}': $PUSH_ERR"
exit 1
fi
fi

Copilot uses AI. Check for mistakes.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is too verbose and it's ok to ignore errors from both git tag and git push

When releasing a docker image for build number X, we should also create
the corresponding git tag. This allows users to easily checkout the
corresponding source tree for given docker image.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
devops improvements to build systems and github actions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant