Skip to content

use error_code to do "is_signed_tag" check to avoid language issue #543

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 7, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix(git): use "git tag -v" return_code to check whether a tag is signed
  • Loading branch information
Lee-W committed Aug 7, 2022
commit ae5a98ef76f512414aa76fc23a3b650acf71df87
7 changes: 1 addition & 6 deletions commitizen/git.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import os
import re
from pathlib import Path
from tempfile import NamedTemporaryFile
from typing import List, Optional
Expand Down Expand Up @@ -143,11 +142,7 @@ def tag_exist(tag: str) -> bool:


def is_signed_tag(tag: str) -> bool:
c = cmd.run(f"git tag -v {tag}")
_ret = False
if re.match("gpg: Signature made [0-9/:A-Za-z ]*", c.err):
_ret = True
return _ret
return cmd.run(f"git tag -v {tag}").return_code == 0


def get_latest_tag_name() -> Optional[str]:
Expand Down