From b5358b59edbbe638b8f86155dc4deee7346b8723 Mon Sep 17 00:00:00 2001 From: David Venable Date: Thu, 29 Aug 2024 10:44:17 -0500 Subject: [PATCH] Adds a script to help generate the Thank You text for the release blogs. (#4884) Adds a script to help generate the Thank You text for the release blogs. Use en dashes in the Thank You text to meet the standards of the project-website. When there is no name for a GitHub user, don't include a None. Signed-off-by: David Venable Co-authored-by: Hai Yan --- release/script/blog/README.md | 18 +++++++++++++++ .../script/blog/format-release-thank-you.py | 22 +++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 release/script/blog/README.md create mode 100755 release/script/blog/format-release-thank-you.py diff --git a/release/script/blog/README.md b/release/script/blog/README.md new file mode 100644 index 0000000000..93d4819f9d --- /dev/null +++ b/release/script/blog/README.md @@ -0,0 +1,18 @@ +# Generate Thank You text for the blog + +The Data Prepper release blogs include text thanking contributors to the project. +This script makes this easier to accomplish. + +You need two tools installed: + +* [GitHub CLI](https://cli.github.com/) +* Python 3 + + +Copy the following command and paste into your CLI. +Modify the dates for `since` and `until` to include when work for this release start through when the the release work ended. + + +``` +gh api --paginate '/repos/opensearch-project/data-prepper/commits?since=2024-05-16&until=2024-08-26' | jq -r '.[].author.login' | sort | uniq | ./format-release-thank-you.py +``` diff --git a/release/script/blog/format-release-thank-you.py b/release/script/blog/format-release-thank-you.py new file mode 100755 index 0000000000..29e4e506e5 --- /dev/null +++ b/release/script/blog/format-release-thank-you.py @@ -0,0 +1,22 @@ +#!python3 + +# +# Copyright OpenSearch Contributors +# SPDX-License-Identifier: Apache-2.0 +# + +import json +import os +import sys + +authors = [] +for author in sys.stdin: + authors.append(author) + + +for author in sorted(authors, key=str.lower): + user = json.loads(os.popen(f"gh api users/{author}").read()) + if user['name'] != None: + print(f"* [{user['login']}]({user['html_url']}) -- {user['name']}") + else: + print(f"* [{user['login']}]({user['html_url']})")