From 2b38c8047d727de658795f5f97f146d8320eb8a6 Mon Sep 17 00:00:00 2001 From: Juan Hernandez Date: Fri, 3 Dec 2021 16:25:00 +0100 Subject: [PATCH] Add changes to releases This patch changes the publish release workflow so that it extracts the list of changes from the `CHANGES.md` file and adds them to the description of the release. Signed-off-by: Juan Hernandez --- .github/workflows/publish-release.yaml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish-release.yaml b/.github/workflows/publish-release.yaml index 98c3686..145623b 100644 --- a/.github/workflows/publish-release.yaml +++ b/.github/workflows/publish-release.yaml @@ -93,6 +93,19 @@ jobs: args = ["sha256sum", asset] subprocess.run(check=True, cwd=assets, stdout=stream, args=args) + # Get the list of changes: + body = "" + with open("CHANGES.md", "r") as stream: + while True: + line = stream.readline() + if line == "" or line.startswith("## " + version): + break + while True: + line = stream.readline() + if line == "" or line.startswith("## "): + break + body += line + # Send the request to create the release: response = requests.post( headers={ @@ -103,7 +116,7 @@ jobs: json={ "tag_name": f"v{version}", "name": f"Release {version}", - "body": f"See the CHANGES.md file for details.", + "body": body, }, url=( "https://api.github.com"