Skip to content

Commit 4ace7fb

Browse files
committed
Add script files to generate release notes.
1 parent cc64b0c commit 4ace7fb

3 files changed

Lines changed: 39 additions & 0 deletions

File tree

docs/history.md

Whitespace-only changes.

utility/generate-release-notes.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import os
2+
3+
import click
4+
5+
6+
@click.command()
7+
@click.option("--prev", required=True, help="Previous version tag")
8+
@click.option("--next", required=True, help="Next version tag")
9+
def main(prev, next):
10+
os.system("git fetch")
11+
cmd = (
12+
'gh api --method POST -H "Accept: application/vnd.github.v3+json" '
13+
+ "/repos/SFDO-Tooling/CumulusCI/releases/generate-notes"
14+
+ f" -f tag_name='{next}' "
15+
+ "-f target_commitish='main' "
16+
+ f"-f previous_tag_name='{prev}' --jq .body "
17+
+ "| pandoc -f gfm -t rst"
18+
)
19+
print(cmd)
20+
os.system(cmd)
21+
22+
23+
if __name__ == "__main__":
24+
main()

utility/update-history.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
"""
2+
Update the history file.
3+
"""
4+
from pathlib import Path
5+
6+
START_MARKER = "<!-- latest-start -->"
7+
STOP_MARKER = "<!-- latest-stop -->"
8+
9+
history = Path("docs/history.md").read_text()
10+
latest = Path("changelog.md").read_text()
11+
updated = history.replace(f"{STOP_MARKER}\n\n", "").replace(
12+
f"{START_MARKER}\n\n", f"{START_MARKER}\n\n{latest}\n\n{STOP_MARKER}\n\n"
13+
)
14+
15+
Path("docs/history.md").write_text(updated)

0 commit comments

Comments
 (0)