Skip to content

Fix: Do NOT fetch tags when workflow trigger was tag push event#70

Merged
ModeSevenIndustrialSolutions merged 1 commit intolfreleng-actions:mainfrom
modeseven-lfreleng-actions:update-action
Aug 14, 2025
Merged

Fix: Do NOT fetch tags when workflow trigger was tag push event#70
ModeSevenIndustrialSolutions merged 1 commit intolfreleng-actions:mainfrom
modeseven-lfreleng-actions:update-action

Conversation

@ModeSevenIndustrialSolutions
Copy link
Contributor

@ModeSevenIndustrialSolutions ModeSevenIndustrialSolutions commented Aug 14, 2025

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, updates the action to use the modern syntax for the workflow/event trigger.

Replaces: startsWith(github.ref, 'refs/tags/')
With: github.ref_type == 'tag'

Copilot AI review requested due to automatic review settings August 14, 2025 15:15
@github-actions github-actions bot added the bug Something isn't working label Aug 14, 2025
Copy link

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 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 modern github.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>
@ModeSevenIndustrialSolutions ModeSevenIndustrialSolutions merged commit 1a8f154 into lfreleng-actions:main Aug 14, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants