Skip to content

Commit f32ba4f

Browse files
committed
generate-release-notes: index.md change reminder
This prevents releases from being made without referencing the new release document in index.md.
1 parent e95b211 commit f32ba4f

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

releng/generate-release-notes

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#! /usr/bin/python3
22

33
import argparse
4+
from datetime import date
45
import os
56
import re
67
import subprocess
@@ -44,7 +45,7 @@ def _limited_config(opts):
4445
return ["--config", opts.temp_config]
4546

4647

47-
def _main():
48+
def _main(): # pylint: disable=too-many-locals
4849
options = _arg_parser().parse_args()
4950
options.temp_config = None
5051
tc_opts = _limited_config(options)
@@ -60,11 +61,23 @@ def _main():
6061
pattern = "|".join(TRANSFORM.keys())
6162
issues_re = re.compile(r"\[(" + pattern + r")#([0-9a-f]+)\]")
6263

63-
6464
cmd = ["towncrier", "build", "--version", options.version] + tc_opts
6565
print(f"Calling {cmd}")
6666
subprocess.check_call(cmd)
6767

68+
subject_cfgs = ""
69+
release_type = "Release-Notes"
70+
if options.configs_only:
71+
release_type += "-Configs"
72+
subject_cfgs = " and Configs ???"
73+
index_md_snippet = (
74+
"## Release Notes\\n"
75+
f"* [{options.version}{subject_cfgs}]"
76+
f"({release_type}-{options.version}) ({date.today()}) - ???"
77+
)
78+
cmd = ["sed", "-i", f's/## Release Notes/{index_md_snippet}/',
79+
'docs/index.md']
80+
6881
with open(output_file, "w", encoding="utf8") as fdout:
6982

7083
fdout.write(f"""---

0 commit comments

Comments
 (0)