Add percentage on result title (#4)
* Add percentage to action name * Test with percentage in output title
This commit is contained in:
parent
2454e13902
commit
b8506db951
@ -18,6 +18,7 @@ class GithubCheckRunService
|
||||
@summary = @report_adapter.summary(@report)
|
||||
@annotations = @report_adapter.annotations(@report)
|
||||
@conclusion = @report_adapter.conslusion(@report)
|
||||
@percent = @report_adapter.lines_covered_percent(@report)
|
||||
|
||||
@client.patch(
|
||||
"#{endpoint_url}/#{id}",
|
||||
@ -48,7 +49,7 @@ class GithubCheckRunService
|
||||
completed_at: Time.now.iso8601,
|
||||
conclusion: @conclusion,
|
||||
output: {
|
||||
title: CHECK_NAME,
|
||||
title: "#{CHECK_NAME} #{@percent}%",
|
||||
summary: @summary,
|
||||
annotations: @annotations
|
||||
}
|
||||
|
||||
@ -18,16 +18,16 @@ class ReportAdapter
|
||||
[]
|
||||
end
|
||||
|
||||
def lines_covered_percent(report)
|
||||
@lines_covered_percent ||= report.dig('lines', 'covered_percent')
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def table_head
|
||||
"| Type | covered | minimum |\n| ----- | ------- | ------- |"
|
||||
end
|
||||
|
||||
def lines_covered_percent(report)
|
||||
@lines_covered_percent ||= report.dig('lines', 'covered_percent')
|
||||
end
|
||||
|
||||
def lines_minimum_percent(report)
|
||||
@lines_minimum_percent ||= report.dig('lines', 'minumum_percent')
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user