Skip to content

Commit

Permalink
Fix standardrb
Browse files Browse the repository at this point in the history
  • Loading branch information
ssaunier committed Dec 21, 2023
1 parent 9924042 commit 595dabb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion app/services/github_checks_verifier.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions app/spec/services/github_checks_verifier_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -139,15 +139,15 @@
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"),
OpenStruct.new(name: "check_name2", status: "queued"),
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
Expand Down Expand Up @@ -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"),
Expand Down
1 change: 0 additions & 1 deletion entrypoint.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 595dabb

Please sign in to comment.