Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retrieve active pull requests against chosen target branch if present #797

Merged
merged 1 commit into from
Sep 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions updater/bin/update_script.rb
Original file line number Diff line number Diff line change
Expand Up @@ -556,8 +556,8 @@ def show_diff(original_file, updated_file)
credentials: $options[:credentials]
)
user_id = azure_client.get_user_id
default_branch_name = azure_client.fetch_default_branch($source.repo)
active_pull_requests = azure_client.pull_requests_active(user_id, default_branch_name)
target_branch_name = $options[:branch] || azure_client.fetch_default_branch($source.repo)
active_pull_requests = azure_client.pull_requests_active(user_id, target_branch_name)

pull_requests_count = 0

Expand Down Expand Up @@ -924,7 +924,7 @@ def show_diff(original_file, updated_file)
# look for pull requests that are no longer needed to be abandoned
if $options[:close_unwanted]
puts "Looking for pull requests that are no longer needed."
active_pull_requests = azure_client.pull_requests_active(user_id, default_branch_name)
active_pull_requests = azure_client.pull_requests_active(user_id, target_branch_name)
active_pull_requests.each do |pr|
pr_id = pr["pullRequestId"]
title = pr["title"]
Expand Down