Skip to content

gh release delete --cleanup-tag won't delete the local tag #7853

@kemingy

Description

@kemingy

Describe the bug

version: 2.32.0 (2023-07-11)

When creating a new release with gh release create nightly --title nightly --generate-notes, if the tag already exists locally, it will fail with error: "tag {{tag}} exists locally but has not been pushed to {{ user/repo }}, please push it before continuing or specify the --target flag to create a new tag".

But the command gh release delete nightly --yes --cleanup-tag only delete the release and tag remotely. Hence if we delete a release with a tag and re-create it again, we will receive an error. This happens when users want to use gh to build the nightly release pipeline.

Steps to reproduce the behavior

  1. Type this:
  • gh release delete nightly --yes --cleanup-tag
  • gh release create nightly --title nightly --generate-notes
  1. View the output 'tag {{tag}} exists locally but has not been pushed to {{ user/repo }}, please push it before continuing or specify the --target flag to create a new tag'
  2. See error

Expected vs actual behavior

  1. It should be okay if the gh release create only checks the remote tag. But I guess it may have some reason to check the local tags.
  2. In this situation, we should make it consistent to create/delete release with gh. Otherwise, users have to use git tag -d <tag> which I think breaks the user experience.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementa request to improve CLIhelp wantedContributions welcome

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions