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)
|
@summary = @report_adapter.summary(@report)
|
||||||
@annotations = @report_adapter.annotations(@report)
|
@annotations = @report_adapter.annotations(@report)
|
||||||
@conclusion = @report_adapter.conslusion(@report)
|
@conclusion = @report_adapter.conslusion(@report)
|
||||||
|
@percent = @report_adapter.lines_covered_percent(@report)
|
||||||
|
|
||||||
@client.patch(
|
@client.patch(
|
||||||
"#{endpoint_url}/#{id}",
|
"#{endpoint_url}/#{id}",
|
||||||
@ -48,7 +49,7 @@ class GithubCheckRunService
|
|||||||
completed_at: Time.now.iso8601,
|
completed_at: Time.now.iso8601,
|
||||||
conclusion: @conclusion,
|
conclusion: @conclusion,
|
||||||
output: {
|
output: {
|
||||||
title: CHECK_NAME,
|
title: "#{CHECK_NAME} #{@percent}%",
|
||||||
summary: @summary,
|
summary: @summary,
|
||||||
annotations: @annotations
|
annotations: @annotations
|
||||||
}
|
}
|
||||||
|
|||||||
@ -18,16 +18,16 @@ class ReportAdapter
|
|||||||
[]
|
[]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def lines_covered_percent(report)
|
||||||
|
@lines_covered_percent ||= report.dig('lines', 'covered_percent')
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def table_head
|
def table_head
|
||||||
"| Type | covered | minimum |\n| ----- | ------- | ------- |"
|
"| Type | covered | minimum |\n| ----- | ------- | ------- |"
|
||||||
end
|
end
|
||||||
|
|
||||||
def lines_covered_percent(report)
|
|
||||||
@lines_covered_percent ||= report.dig('lines', 'covered_percent')
|
|
||||||
end
|
|
||||||
|
|
||||||
def lines_minimum_percent(report)
|
def lines_minimum_percent(report)
|
||||||
@lines_minimum_percent ||= report.dig('lines', 'minumum_percent')
|
@lines_minimum_percent ||= report.dig('lines', 'minumum_percent')
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user