This repository has been archived on 2025-03-02. You can view files and clone it, but cannot push or open issues or pull requests.
GalacticFactory-Legacy/.gitea/workflows/scripts/message.py
SeaswimmerTheFsh 3ccff59d40
Some checks failed
Autotagger / Autotagger (push) Failing after 4s
Build / Export Files (push) Successful in 6s
Build / Documentation (push) Successful in 18s
testing a fix to the issue templates
2024-03-23 14:46:54 -04:00

20 lines
526 B
Python

import re
import sys
from typing import Optional
pattern = r"^(?:V|v)ersion\ bump(?:ed)?\ to\ ([0-9]+\.[0-9]+\.[0-9]+(?:-[a-zA-Z0-9]+)?).*"
def get_commit_message(string) -> Optional[str]:
m = re.match(pattern, string)
if m:
return m.group(1)
else:
return None
if __name__ == "__main__":
if len(sys.argv) >= 2:
commit_message = sys.argv[1]
result = get_commit_message(commit_message)
print(result)
else:
print("Usage: python message.py <commit_message>")