Skip to content

Commit 73b28d2

Browse files
committed
oops, forgot part of the workflow, I do not want this message to appear in the changelog #hide
1 parent 45eb34e commit 73b28d2

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

scripts/filter_changelog.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/usr/bin/env python3
2+
3+
import argparse
4+
import sys
5+
6+
HASHTAG_RELEASE = "#release"
7+
HASHTAG_HIDE_CHANGELOG = "#hide"
8+
9+
tags = [HASHTAG_RELEASE, HASHTAG_HIDE_CHANGELOG]
10+
11+
def filter_out_tags(commit):
12+
for tag in tags:
13+
commit.replace(tag, "")
14+
return commit
15+
16+
if __name__ == '__main__':
17+
commits = [line.strip() for line in sys.stdin]
18+
19+
build_new = True if len(commits) > 0 and HASHTAG_RELEASE in commits[0] else False
20+
if not build_new:
21+
sys.exit(0)
22+
23+
first_commit = True
24+
for commit in commits:
25+
# read commits till the last commit that is marked by `HASHTAG_RELEASE`
26+
if not first_commit and HASHTAG_RELEASE in commit:
27+
break
28+
if first_commit:
29+
first_commit = False
30+
if HASHTAG_HIDE_CHANGELOG not in commit:
31+
print(filter_out_tags(commit))

0 commit comments

Comments
 (0)