diff --git a/Gemfile.lock b/Gemfile.lock index f6dc00d3..5f997c0b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -64,7 +64,7 @@ GEM net-http faraday-retry (2.2.1) faraday (~> 2.0) - fbe (0.0.60) + fbe (0.0.61) backtrace (> 0) decoor (> 0) factbase (> 0) diff --git a/judges/github-events/github-events.rb b/judges/github-events/github-events.rb index ee1b1d60..aa2fa23e 100644 --- a/judges/github-events/github-events.rb +++ b/judges/github-events/github-events.rb @@ -126,6 +126,7 @@ def self.fetch_workflows(pr) succeeded_builds = 0 failed_builds = 0 Fbe.octo.check_runs_for_ref(pr[:base][:repo][:full_name], pr[:head][:sha])[:check_runs].each do |run| + next unless run[:app][:slug] == 'github-actions' workflow = Fbe.octo.workflow_run( pr[:base][:repo][:full_name], Fbe.octo.workflow_run_job(pr[:base][:repo][:full_name], run[:id])[:run_id] diff --git a/judges/github-events/scan-many-repos.yml b/judges/github-events/scan-many-repos.yml index 29116608..6461a9bc 100644 --- a/judges/github-events/scan-many-repos.yml +++ b/judges/github-events/scan-many-repos.yml @@ -27,4 +27,4 @@ options: repositories: yegor256/judges,yegor256/factbase,zerocracy/baza runs: 5 expected: - - /fb[count(f)=6] + - /fb[count(f)=7] diff --git a/test/judges/test-github-events.rb b/test/judges/test-github-events.rb index 1eef902e..2509fd9a 100644 --- a/test/judges/test-github-events.rb +++ b/test/judges/test-github-events.rb @@ -917,12 +917,24 @@ def test_pull_request_event_with_comments def test_count_numbers_of_workflow_builds fb = Factbase.new - load_it('github-events', fb, Judges::Options.new({ 'repositories' => 'foo/foo', 'testing' => true })) - f = fb.query('(eq what "pull-was-merged")').each.to_a.first + load_it('github-events', fb, Judges::Options.new({ 'repositories' => 'zerocracy/baza', 'testing' => true })) + f = fb.query('(and (eq what "pull-was-merged") (eq event_id 42))').each.to_a.first assert_equal(4, f.succeeded_builds) assert_equal(2, f.failed_builds) end + def test_count_numbers_of_workflow_builds_only_from_github + fb = Factbase.new + load_it( + 'github-events', + fb, + Judges::Options.new({ 'repositories' => 'zerocracy/judges-action', 'testing' => true }) + ) + f = fb.query('(and (eq what "pull-was-merged") (eq event_id 43))').each.to_a.first + assert_equal(3, f.succeeded_builds) + assert_equal(2, f.failed_builds) + end + private def stub_event(*json)