Fix: Do NOT fetch tags when workflow trigger was tag push event#70
Merged
ModeSevenIndustrialSolutions merged 1 commit intolfreleng-actions:mainfrom Aug 14, 2025
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a Git tag clobbering issue when triggering releases via tag push events in repositories using dynamic versioning. The fix prevents fetching tags when the workflow is triggered by a tag push event, and also modernizes GitHub Actions conditional syntax.
- Skip tag fetching when the trigger event is a tag push to avoid tag conflicts
- Update GitHub Actions conditional syntax from legacy
startsWith(github.ref, 'refs/tags/')to moderngithub.ref_type == 'tag'
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
This fixes the error message below when triggering releases and pushing tags to repositories where the Python project uses dynamic versioning. ! [rejected] v0.1.40 -> v0.1.40 (would clobber existing tag) Error: git fetch --tags failed Error: Process completed with exit code 1. Also, update the action to use the modern syntax: Replaces: startsWith(github.ref, 'refs/tags/') With: github.ref_type == 'tag' Signed-off-by: Matthew Watkins <mwatkins@linuxfoundation.org>
2971ffa to
ad3a4ee
Compare
keanjapesan
approved these changes
Aug 14, 2025
1a8f154
into
lfreleng-actions:main
5 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes the error message below when triggering releases and pushing tags to repositories where the Python project uses dynamic versioning.
Also, updates the action to use the modern syntax for the workflow/event trigger.
Replaces: startsWith(github.ref, 'refs/tags/')
With: github.ref_type == 'tag'