Skip to content

Commit

Permalink
Retrieve active pull requests against chosen target branch if present
Browse files Browse the repository at this point in the history
  • Loading branch information
mburumaxwell committed Sep 15, 2023
1 parent 9c3c94d commit e973aaf
Showing 1 changed file with 3 additions and 3 deletions.
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

0 comments on commit e973aaf

Please sign in to comment.