diff options
author | lovetox <philipp@hoerist.com> | 2022-05-18 21:51:45 +0300 |
---|---|---|
committer | lovetox <philipp@hoerist.com> | 2022-05-19 22:24:02 +0300 |
commit | 2b460bb7caeceb15b512c5dd9f40ad12088bccd1 (patch) | |
tree | a461f8c3c2dbcabc6076881b7361a4d362a35b3e /.githooks | |
parent | d75ac0918fe03a1fbece36179c4ada55f7ca186a (diff) |
chore: Update githooks
Diffstat (limited to '.githooks')
-rwxr-xr-x | .githooks/update | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/.githooks/update b/.githooks/update index f8014da30..fe5bc3a04 100755 --- a/.githooks/update +++ b/.githooks/update @@ -18,14 +18,15 @@ ALLOWED_TAGS = [ 'chore', 'release', 'other', + 'imprv', ] - -def parse_args() -> Tuple[str, str]: +def parse_args() -> Tuple[str, str, str]: + ref_name = sys.argv[1] old_ref = sys.argv[2] new_ref = sys.argv[3] - return old_ref, new_ref + return ref_name, old_ref, new_ref def get_commit_subject(sha: str) -> str: @@ -64,8 +65,12 @@ def enforce_message_rules(subject: str) -> None: sys.exit(1) -def main(args: Tuple[str, str]) -> None: - shas = get_commit_shas(*args) +def main(args: Tuple[str, str, str]) -> None: + ref_name, old_ref, new_ref = args + if 'refs/tags' in ref_name: + return + + shas = get_commit_shas(old_ref, new_ref) for sha in shas: subject = get_commit_subject(sha) enforce_message_rules(subject) |