Skip to content

Release verification fetch prunes the newly created tag #1509

Open

Description

@jmartens

Description

I ran the initial release with Python Semantic Release 10.7.0. With Git tag pruning enabled (fetch.pruneTags=true), the release commit was created and pushed, but the newly created local release tag was removed during the upstream verification fetch. Semantic Release then failed to push the tag.

Expected behavior

The upstream verification fetch should not remove the release tag created by the current invocation. Both the release commit and tag should be pushed successfully.

Actual behavior

The upstream branch verification succeeded, but the tag push failed because the local tag ref no longer existed:

error: src refspec refs/tags/v1.0.0 does not match any
GitPushError: Failed to push tag (v1.0.0) to remote

The release commit had already been pushed.

Environment

Operating System (w/ version): Windows (version not recorded)
Python version: 3.15.2
Pip version: Not installed in the uv-managed environment
Semantic-release version: 10.7.0
Build tool (w/ version): uv 0.13.6

Configuration

Semantic Release Configuration
[tool.semantic_release]
assets = ["uv.lock"]
allow_zero_version = false
version_toml = ["pyproject.toml:project.version"]
tag_format = "v{version}"
commit_parser = "conventional"
commit_parser_options = { minor_tags = ["feat"], patch_tags = ["fix", "perf", "docs"] }
build_command = "uv lock"

[tool.semantic_release.branches.main]
match = "main"
prerelease = false

[tool.semantic_release.remote]
type = "bitbucket"
ignore_token_for_push = true

Execution Log

uv run semantic-release -vvv version --no-vcs-release
Running build command uv lock
Build completed successfully!
Fetching latest changes from remote 'origin'
Verified upstream branch 'origin/main' has not changed
error: src refspec refs/tags/v1.0.0 does not match any
GitPushError: Failed to push tag (v1.0.0) to remote

Additional context

Git had fetch.prune=true and fetch.pruneTags=true. Semantic Release creates the tag before checking whether the upstream branch changed; the verification fetch prunes the new tag because it is not on the remote yet.
This repository-specific override prevented the failure:

git config --local remote.origin.pruneTags false

With that override, the initial release completed successfully.

Activity

  1. added
    bug
    triage
    on Nov 13, 2026
  2. added
    confirmed
    and removed
    triage
    on Nov 13, 2026
  3. codejedi365 commented on Nov 13, 2026

    @codejedi365
    Contributor

    Thank you for narrowing the cause down to this external configuration. It would have been very difficult for me to do. I'll see if there is a way to prevent that external git configuration from having an effect during the upstream verification fetch.

  4. jmartens commented on Nov 13, 2026

    @jmartens
    ContributorAuthor

    Not sure if it is doable otherwise it might be a corner case to document in known problems section.

  5. jmartens commented on Nov 14, 2026

    @jmartens
    ContributorAuthor

    I was thinking along the same line and was planning to test it Monday when I return to work, but you beat me to it @TiantianYZJ.

    Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugconfirmed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions