Skip to content

Commit

Permalink
chore: do not attempt to automerge generation PRs if there is no appr…
Browse files Browse the repository at this point in the history
…oval token
  • Loading branch information
dazuma committed Jul 24, 2024
1 parent 89c5632 commit db4f7e7
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions .toys/generate-updates.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,13 @@ def pr_single_gem api, version, index, total
puts "(#{index}/#{total}) Pull request already exists for google-apis-#{api}_#{version}", :yellow
return
end
approval_message = "Rubber-stamped client auto-generation!"
approval_message = approval_token ? "Rubber-stamped client auto-generation!" : nil
labels = approval_token ? ["automerge"] : nil
result = yoshi_pr_generator.capture enabled: !git_remote.nil?,
remote: git_remote,
branch_name: branch_name,
commit_message: commit_message,
labels: ["automerge"],
labels: labels,
auto_approve: approval_message,
approval_token: approval_token do
regen_single_gem api, version
Expand All @@ -115,12 +116,13 @@ def pr_clean_old_gems
puts "Pull request already exists for cleaning obsolete gems", :yellow
return
end
approval_message = "Rubber-stamped cleanup of obsolete gems!"
approval_message = approval_token ? "Rubber-stamped cleanup of obsolete gems!" : nil
labels = approval_token ? ["automerge"] : nil
result = yoshi_pr_generator.capture enabled: !git_remote.nil?,
remote: git_remote,
branch_name: branch_name,
commit_message: commit_message,
labels: ["automerge"],
labels: labels,
auto_approve: approval_message,
approval_token: approval_token do
clean_old_gems
Expand Down

0 comments on commit db4f7e7

Please sign in to comment.