github: use system_command when pushing bump PR

This commit is contained in:
Caleb Xu 2021-11-10 09:01:50 -05:00
parent 227b8148eb
commit 333f44f84e
No known key found for this signature in database
GPG Key ID: 2F67B6BC86DC4F00

View File

@ -5,12 +5,16 @@ require "uri"
require "utils/github/actions" require "utils/github/actions"
require "utils/github/api" require "utils/github/api"
require "system_command"
# Wrapper functions for the GitHub API. # Wrapper functions for the GitHub API.
# #
# @api private # @api private
module GitHub module GitHub
extend T::Sig extend T::Sig
include SystemCommand::Mixin
module_function module_function
def check_runs(repo: nil, commit: nil, pr: nil) def check_runs(repo: nil, commit: nil, pr: nil)
@ -530,7 +534,8 @@ module GitHub
"--", *changed_files "--", *changed_files
return if args.commit? return if args.commit?
safe_system "git", "push", "--set-upstream", remote_url, "#{branch}:#{branch}" system_command!("git", args: ["push", "--set-upstream", remote_url, "#{branch}:#{branch}"],
print_stdout: true)
safe_system "git", "checkout", "--quiet", previous_branch safe_system "git", "checkout", "--quiet", previous_branch
pr_message = <<~EOS pr_message = <<~EOS
#{pr_message} #{pr_message}