lib/neetob/cli/github/make_pr/script.rb in neetob-0.4.4 vs lib/neetob/cli/github/make_pr/script.rb in neetob-0.4.5
- old
+ new
@@ -8,21 +8,23 @@
class CLI
module Github
module MakePr
class Script < Base
attr_accessor :repos, :sandbox, :path_to_the_script_file, :pr_description, :should_fix_nanos,
- :should_fix_frontend_packages
+ :should_fix_frontend_packages, :labels
def initialize(repos, path_to_the_script_file, pr_title,
- branch_name, pr_description, should_fix_nanos, should_fix_frontend_packages = false, sandbox = false)
+ branch_name, pr_description, should_fix_nanos,
+ should_fix_frontend_packages = false, sandbox = false, labels = "")
super(pr_title, branch_name)
@repos = repos
@sandbox = sandbox
@path_to_the_script_file = path_to_the_script_file
@pr_description = pr_description
@should_fix_nanos = should_fix_nanos
@should_fix_frontend_packages = should_fix_frontend_packages
+ @labels = labels
end
def run
matching_repos = build_matching_repos_list(should_fix_nanos, should_fix_frontend_packages)
delete_and_create_temp_neetob_dir
@@ -33,11 +35,12 @@
check_and_delete_remote_branch(repo)
update_script_file_permissions
execute_script(repo)
ui.info(add_commmit_and_push_changes(repo))
delete_local_feature_branch(repo)
- res = client.create_pull_request(repo, "main", branch_name, pr_title, pr_description)
+ pull_request = client.create_pull_request(repo, "main", branch_name, pr_title, pr_description)
ui.success("PR created in \"#{repo}\" project successfully.")
+ client.add_labels_to_an_issue(repo, pull_request[:number], labels.split(","))
rescue StandardError => e
ExceptionHandler.new(e).process
end
end
`rm -rf /tmp/neetob`