Use full URL to link test suites

GitHub UI for some unknown reason navigates user to check run with `check_suite_focus=true` query argument. With this argument unfortunately navigation to document ID with `#something` doesn't work
This commit is contained in:
Michal Dorner
2021-03-31 23:22:02 +02:00
parent f48646179b
commit fab342311c
4 changed files with 45 additions and 19 deletions

View File

@@ -146,9 +146,22 @@ class TestReporter {
results.push(tr)
}
core.info(`Creating check run ${name}`)
const createResp = await this.octokit.checks.create({
head_sha: this.context.sha,
name,
status: 'in_progress',
output: {
title: name,
summary: ''
},
...github.context.repo
})
core.info('Creating report summary')
const {listSuites, listTests} = this
const summary = getReport(results, {listSuites, listTests})
const baseUrl = createResp.data.html_url
const summary = getReport(results, {listSuites, listTests, baseUrl})
core.info('Creating annotations')
const annotations = getAnnotations(results, this.maxAnnotations)
@@ -157,10 +170,9 @@ class TestReporter {
const conclusion = isFailed ? 'failure' : 'success'
const icon = isFailed ? Icon.fail : Icon.success
core.info(`Creating check run with conclusion ${conclusion}`)
const resp = await this.octokit.checks.create({
head_sha: this.context.sha,
name,
core.info(`Updating check run conclusion (${conclusion}) and output`)
const resp = await this.octokit.checks.update({
check_run_id: createResp.data.id,
conclusion,
status: 'completed',
output: {