From ee95a73daf97873b667e9fdcb07ffe81a53edc16 Mon Sep 17 00:00:00 2001 From: Janosch Machowinski Date: Thu, 10 Sep 2026 16:58:43 +0200 Subject: [PATCH 1/4] fix: Bump PyGithub to correct version Signed-off-by: Janosch Machowinski --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 73a22a3..fa48804 100644 --- a/setup.py +++ b/setup.py @@ -21,7 +21,7 @@ long_description=long_description, install_requires=[ 'markdown2==2.3.7', - 'PyGithub==1.56', + 'PyGithub>=1.59.1,<2', 'PyYAML>=5', 'retrying==1.3.3', 'jenkinsapi==0.3.17', From 65c389fd145d697209e5c690b4174c6a94fecbc0 Mon Sep 17 00:00:00 2001 From: Janosch Machowinski Date: Thu, 10 Sep 2026 16:59:15 +0200 Subject: [PATCH 2/4] fix: update installation cmd to working version Signed-off-by: Janosch Machowinski --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 163feaa..b053b5e 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ This is a `setuptools`-based python package. To install it and all its dependenc ``` # Note that this is by _path_, it's not the name of a package on PyPI - so substitute as appropriate for your working directory -pip3 install ./ros-github-scripts +pipx install ./ros-github-scripts ``` From ea711bb84f3ce07b051f560c589ec785e7c6779d Mon Sep 17 00:00:00 2001 From: Janosch Machowinski Date: Thu, 10 Sep 2026 16:59:37 +0200 Subject: [PATCH 3/4] feat: Warn if target branch does not match specified target --- ros_github_scripts/ci_for_pr.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/ros_github_scripts/ci_for_pr.py b/ros_github_scripts/ci_for_pr.py index 49abced..c41e982 100755 --- a/ros_github_scripts/ci_for_pr.py +++ b/ros_github_scripts/ci_for_pr.py @@ -210,6 +210,28 @@ def validate_and_fetch_pull_list( return return_prs +def validate_pulls_target( + pulls: List[github.PullRequest.PullRequest], + target_release: str +) -> None: + """Prompt for confirmation if any PR's base branch does not match the target release.""" + mismatches = [ + (pull, pull.base.ref) + for pull in pulls + if pull.base.ref != target_release + ] + if not mismatches: + return + + print('\n>>> The following PRs target a different branch than the selected release <<<') + for pull, base_ref in mismatches: + print(f' {pull.base.repo.full_name}#{pull.number}: {base_ref}') + print(f' Selected target release: {target_release}') + answer = input('Continue anyway? [y/N] ').strip().lower() + if answer != 'y': + panic('Target mismatch, aborting') + + def format_ci_details( *, gist_url: Optional[str], @@ -541,6 +563,9 @@ def main(): 'When using --branch and --comment, you must select PRs to comment on either using ' '--interactive or by providing them using --pulls') + if chosen_pulls: + validate_pulls_target(chosen_pulls, parsed.target) + # Only create a gist if we are triggering a build (not for --test-report only) gist_url = None if chosen_pulls and not branch_name and not parsed.test_report: From e0a92daf8a1557e02473690164eef9b855d94407 Mon Sep 17 00:00:00 2001 From: Janosch Machowinski Date: Fri, 11 Sep 2026 16:37:06 +0200 Subject: [PATCH 4/4] fix: Only perform the check is pushing to a build server Signed-off-by: Janosch Machowinski --- ros_github_scripts/ci_for_pr.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ros_github_scripts/ci_for_pr.py b/ros_github_scripts/ci_for_pr.py index c41e982..7f72fe3 100755 --- a/ros_github_scripts/ci_for_pr.py +++ b/ros_github_scripts/ci_for_pr.py @@ -563,7 +563,7 @@ def main(): 'When using --branch and --comment, you must select PRs to comment on either using ' '--interactive or by providing them using --pulls') - if chosen_pulls: + if parsed.build and chosen_pulls: validate_pulls_target(chosen_pulls, parsed.target) # Only create a gist if we are triggering a build (not for --test-report only)