Skip to content

Commit e52a25a

Browse files
committed
Support release commit in changelog script
1 parent d546a0a commit e52a25a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

changelog.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from datetime import datetime
12
from github import Github
23
from pprint import pprint
34
import os
@@ -25,6 +26,8 @@
2526
shell=True,
2627
).decode('utf8').split('\n')
2728

29+
now = datetime.now()
30+
2831
tags = {}
2932
tag_commits = []
3033
for line in git_log:
@@ -43,11 +46,14 @@
4346

4447
for sha in shas:
4548
line = []
46-
commit = repo.get_commit(sha)
4749
author, description = subprocess.check_output(
4850
f"git log --format='%an--sep--%B' -n1 {sha}",
4951
shell=True,
5052
).decode('utf8').split('\n')[0].split('--sep--')
53+
if description.startswith('Release '):
54+
lines.append(f' {now.year}-{now.month}-{now.day} {description}')
55+
continue
56+
commit = repo.get_commit(sha)
5157
pulls = [*commit.get_pulls()]
5258
numbers = []
5359
users = []

0 commit comments

Comments
 (0)