Skip to content

Commit

Permalink
Add support for both cl text and emoji
Browse files Browse the repository at this point in the history
  • Loading branch information
PsiOmegaDelta committed Mar 20, 2021
1 parent 0166dcb commit e4d3c02
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tools/changelog/generate_cl.py
Expand Up @@ -28,7 +28,7 @@
from ruamel import yaml
from github import Github, InputGitAuthor

CL_BODY = re.compile(r":cl:(.+)?\r\n((.|\n|\r)+?)\r\n\/:cl:", re.MULTILINE)
CL_BODY = re.compile(r"(:cl:|🆑)(.+)?\r\n((.|\n|\r)+?)\r\n\/(:cl:|🆑)", re.MULTILINE)
CL_SPLIT = re.compile(r"(^\w+):\s+(\w.+)", re.MULTILINE)

git_email = os.getenv("GIT_EMAIL")
Expand Down Expand Up @@ -57,14 +57,14 @@
write_cl = {}
try:
cl = CL_BODY.search(pr_body)
cl_list = CL_SPLIT.findall(cl.group(2))
cl_list = CL_SPLIT.findall(cl.group(3))
except AttributeError:
print("No CL found!")
exit(0) # Change to '0' if you do not want the action to fail when no CL is provided


if cl.group(1) is not None:
write_cl['author'] = cl.group(1).lstrip()
if cl.group(2) is not None:
write_cl['author'] = cl.group(2).lstrip()
else:
write_cl['author'] = pr_author

Expand Down

0 comments on commit e4d3c02

Please sign in to comment.