lib/neetob/cli/github/make_pr/compliance_fix.rb in neetob-0.4.4 vs lib/neetob/cli/github/make_pr/compliance_fix.rb in neetob-0.4.5

- old
+ new

@@ -7,18 +7,19 @@ module Neetob class CLI module Github module MakePr class ComplianceFix < Base - attr_accessor :repos, :sandbox, :should_fix_nanos + attr_accessor :repos, :sandbox, :should_fix_nanos, :labels - def initialize(repos, should_fix_nanos = false, sandbox = false) + def initialize(repos, should_fix_nanos = false, sandbox = false, labels = "") super() @repos = repos @sandbox = sandbox @should_fix_nanos = should_fix_nanos @failed_repos = [] + @labels = labels end def run matching_repos = build_matching_repos_list(should_fix_nanos) @failed_repos = matching_repos.clone @@ -32,9 +33,10 @@ fix_neeto_audit(repo) ui.info(add_commmit_and_push_changes(repo)) delete_local_feature_branch(repo) pull_request = client.create_pull_request(repo, "main", BRANCH_NAME, PR_TITLE) ui.success("PR created in \"#{repo}\" project successfully.") + client.add_labels_to_an_issue(repo, pull_request[:number], labels.split(",")) @failed_repos.delete(repo) rescue StandardError => e ExceptionHandler.new(e).process end end