forked from opensearch-project/data-prepper
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds a script to help generate the Thank You text for the release blo…
…gs. (opensearch-project#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 <dlv@amazon.com> Co-authored-by: Hai Yan <oeyh@amazon.com>
- Loading branch information
Showing
2 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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']})") |