From dcba08c9c2c4feacffc0e10003e640ec06062401 Mon Sep 17 00:00:00 2001 From: Vanessasaurus <814322+vsoch@users.noreply.github.com> Date: Fri, 6 Jan 2023 20:03:27 -0700 Subject: [PATCH] Check for PR branch before using the API so we hopefully save a call. --- pull-request.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pull-request.py b/pull-request.py index f51cbe4..7a768b7 100755 --- a/pull-request.py +++ b/pull-request.py @@ -357,7 +357,10 @@ def main(): print("No branch prefix is set, all branches will be used.") # Default to project default branch if none provided - pull_request_branch = os.environ.get("PULL_REQUEST_BRANCH", find_default_branch()) + pull_request_branch = os.environ.get("PULL_REQUEST_BRANCH") + if not pull_request_branch: + pull_request_branch = find_default_branch() + print("Pull requests will go to %s" % pull_request_branch) # Pull request draft