From 64940fad4a6b0b2c35ad79bc05e34be1b26197a6 Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Fri, 13 Feb 2026 15:10:39 +0000 Subject: [PATCH 1/2] Use author if they are GitHub staff --- .github/update-release-branch.py | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/.github/update-release-branch.py b/.github/update-release-branch.py index 0ea816b8a9..548dd476e8 100644 --- a/.github/update-release-branch.py +++ b/.github/update-release-branch.py @@ -71,8 +71,9 @@ def open_pr( body.append('') body.append('Contains the following pull requests:') for pr in pull_requests: - merger = get_merger_of_pr(repo, pr) - body.append(f'- #{pr.number} (@{merger})') + # Use PR author if they are GitHub staff, otherwise use the merger + display_user = get_pr_author_if_staff(pr) or get_merger_of_pr(repo, pr) + body.append(f'- #{pr.number} (@{display_user})') # List all commits not part of a PR if len(commits_without_pull_requests) > 0: @@ -168,6 +169,17 @@ def get_pr_for_commit(commit): def get_merger_of_pr(repo, pr): return repo.get_commit(pr.merge_commit_sha).author.login +# Get the PR author if they are GitHub staff, otherwise None. +def get_pr_author_if_staff(pr): + if pr.user is None: + return None + try: + if getattr(pr.user, 'site_admin', False): + return pr.user.login + except Exception: + pass + return None + def get_current_version(): with open('package.json', 'r') as f: return json.load(f)['version'] @@ -181,9 +193,9 @@ def replace_version_package_json(prev_version, new_version): print(line.replace(prev_version, new_version), end='') else: prev_line_is_codeql = False - print(line, end='') + print(line, end='') if '\"name\": \"codeql\",' in line: - prev_line_is_codeql = True + prev_line_is_codeql = True def get_today_string(): today = datetime.datetime.today() From 248d7971c26d1ec50837b2fd1c34f13537a6fb66 Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Sun, 15 Feb 2026 15:23:38 +0000 Subject: [PATCH 2/2] Remove superfluous `try`/`catch` --- .github/update-release-branch.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/update-release-branch.py b/.github/update-release-branch.py index 548dd476e8..90e0592593 100644 --- a/.github/update-release-branch.py +++ b/.github/update-release-branch.py @@ -173,11 +173,8 @@ def get_merger_of_pr(repo, pr): def get_pr_author_if_staff(pr): if pr.user is None: return None - try: - if getattr(pr.user, 'site_admin', False): - return pr.user.login - except Exception: - pass + if getattr(pr.user, 'site_admin', False): + return pr.user.login return None def get_current_version():