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

Github::Check class #71

Merged
Merged
Show file tree
Hide file tree
Changes from all 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
14 changes: 10 additions & 4 deletions lib/github/check.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def create(name)
@check_suite.pull_request.repository,
name,
@check_suite.commit_sha_ref,
accept: 'application/vnd.github+json'
accept: 'application/vnd.github.antiope-preview+json'
)
end

Expand Down Expand Up @@ -92,14 +92,20 @@ def skipped(check_ref, output = {})
end

def get_check_run(check_ref)
@app.check_run(@check_suite.pull_request.repository, check_ref).to_h
@app.check_run(@check_suite.pull_request.repository,
check_ref,
accept: 'application/vnd.github.antiope-preview+json').to_h
end

def fetch_check_runs
return [] if @check_suite.nil?

@app
.check_runs_for_ref(@check_suite.pull_request.repository, @check_suite.pull_request.branch_name)
.check_runs_for_ref(
@check_suite.pull_request.repository,
@check_suite.pull_request.branch_name,
accept: 'application/vnd.github.antiope-preview+json'
)
.to_h[:check_runs]
.map do |check_run|
check_run[:id]
Expand Down Expand Up @@ -129,7 +135,7 @@ def fetch_username(username)
def basic_status(check_ref, status, output)
opts = {
status: status,
accept: 'application/vnd.github+json'
accept: 'application/vnd.github.antiope-preview+json'
}

opts[:output] = output unless output.empty?
Expand Down
8 changes: 4 additions & 4 deletions spec/lib/github/check_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
before do
allow(fake_client).to receive(:create_check_run)
.with(check_suite.pull_request.repository, name,
check_suite.commit_sha_ref, accept: 'application/vnd.github+json')
check_suite.commit_sha_ref, accept: 'application/vnd.github.antiope-preview+json')
.and_return(pr_info)
end

Expand All @@ -110,7 +110,7 @@
id,
{
status: status,
accept: 'application/vnd.github+json'
accept: 'application/vnd.github.antiope-preview+json'
})
.and_return(pr_info)
end
Expand All @@ -133,7 +133,7 @@
{
status: status,
output: output,
accept: 'application/vnd.github+json'
accept: 'application/vnd.github.antiope-preview+json'
})
.and_return(pr_info)
end
Expand Down Expand Up @@ -199,7 +199,7 @@
{
status: status,
conclusion: conclusion,
accept: 'application/vnd.github+json'
accept: 'application/vnd.github.antiope-preview+json'
})
.and_return(true)
end
Expand Down
Loading