diff --git a/app/services/github_checks_verifier.rb b/app/services/github_checks_verifier.rb index b429ac2..16ec334 100644 --- a/app/services/github_checks_verifier.rb +++ b/app/services/github_checks_verifier.rb @@ -15,7 +15,7 @@ class GithubChecksVerifier < ApplicationService config_accessor(:check_regexp) { "" } config_accessor(:allowed_conclusions) { ["success", "skipped"] } config_accessor(:verbose) { true } - config_accessor(:ignore_checks){[]} + config_accessor(:ignore_checks) { [] } def call wait_for_checks diff --git a/app/spec/services/github_checks_verifier_spec.rb b/app/spec/services/github_checks_verifier_spec.rb index a66f8be..f794668 100644 --- a/app/spec/services/github_checks_verifier_spec.rb +++ b/app/spec/services/github_checks_verifier_spec.rb @@ -139,7 +139,7 @@ service.send(:apply_filters, checks) expect(checks.map(&:name)).to all(eq "other_check") end - + it "filters out only ignore_checks" do checks = [ OpenStruct.new(name: "check_name1", status: "queued"), @@ -147,7 +147,7 @@ OpenStruct.new(name: "other_check", status: "queued") ] - service.config.ignore_checks = ["check_name1","check_name2"] + service.config.ignore_checks = ["check_name1", "check_name2"] service.send(:apply_filters, checks) expect(checks.map(&:name)).to all(eq "other_check") end @@ -175,18 +175,18 @@ expect(checks.map(&:name)).not_to include("workflow_name") end - + it "does not filter if ignore checks are empty" do checks = [ OpenStruct.new(name: "test1", status: "completed", conclusion: "success"), OpenStruct.new(name: "test2", status: "completed", conclusion: "skipped") ] service.config.ignore_checks = [] - service.send(:apply_filters, checks) - + service.send(:apply_filters, checks) + expect(checks.size).to eq 2 - end - + end + it "apply the regexp filter" do checks = [ OpenStruct.new(name: "test", status: "pending"), diff --git a/entrypoint.rb b/entrypoint.rb index 7310295..9dc4a70 100755 --- a/entrypoint.rb +++ b/entrypoint.rb @@ -12,7 +12,6 @@ workflow_name = ENV["RUNNING_WORKFLOW_NAME"] api_endpoint = ENV.fetch("API_ENDPOINT", "") ignore_checks = ENV["IGNORE_CHECKS"] - GithubChecksVerifier.configure do |config| config.allowed_conclusions = allowed_conclusions.split(",").map(&:strip)