Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#311 fix "workflow not found" error #312

Merged
merged 7 commits into from
Aug 25, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions judges/github-events/github-events.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion judges/github-events/scan-many-repos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ options:
repositories: yegor256/judges,yegor256/factbase,zerocracy/baza
runs: 5
expected:
- /fb[count(f)=6]
- /fb[count(f)=7]
14 changes: 12 additions & 2 deletions test/judges/test-github-events.rb
Original file line number Diff line number Diff line change
Expand Up @@ -917,12 +917,22 @@ 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
repo = 'zerocracy/baza'
load_it('github-events', fb, Judges::Options.new({ 'repositories' => repo, 'testing' => true }))
f = fb.query("(and (eq what \"pull-was-merged\") (eq branch \"#{repo}\"))").each.to_a.first
Suban05 marked this conversation as resolved.
Show resolved Hide resolved
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
repo = 'zerocracy/judges-action'
load_it('github-events', fb, Judges::Options.new({ 'repositories' => repo, 'testing' => true }))
f = fb.query("(and (eq what \"pull-was-merged\") (eq branch \"#{repo}\"))").each.to_a.first
Suban05 marked this conversation as resolved.
Show resolved Hide resolved
assert_equal(3, f.succeeded_builds)
assert_equal(2, f.failed_builds)
end

private

def stub_event(*json)
Expand Down