Skip to content

Commit

Permalink
cicd: Update release notes mentions (open-policy-agent#4207)
Browse files Browse the repository at this point in the history
Since Github will automatically link to user profiles mentioned
by their username, _and_ create a "Contributors" section for the
release notes with user avatars, it seems good to follow that
convention.

Signed-off-by: Anders Eknert <anders@eknert.com>
  • Loading branch information
anderseknert committed Jan 11, 2022
1 parent c676a7e commit 38d0df0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions build/changelog.py
Expand Up @@ -102,15 +102,15 @@ def get_github_id(commit_message, commit_id, token):
def mention_author(commit_message, commit_id, token):
username = get_github_id(commit_message, commit_id, token)
if username not in org_members_usernames:
return "authored by @[{author}](https://github.com/{author})".format(author=username)
return "authored by @{author}".format(author=username)
return ""

def get_issue_reporter(issue_id, token):
url = "https://api.github.com/repos/open-policy-agent/opa/issues/{issue_id}".format(issue_id=issue_id)
issue_data = fetch(url, token)
username = issue_data.get("user", "").get("login", "")
if username not in org_members_usernames:
return "reported by @[{reporter}](https://github.com/{reporter})".format(reporter=username)
return "reported by @{reporter}".format(reporter=username)
return ""

def fixes_issue_id(commit_message):
Expand Down

0 comments on commit 38d0df0

Please sign in to comment.