mirror of
https://github.com/dorny/test-reporter.git
synced 2025-12-18 15:07:10 +01:00
feat: post pr comment
This commit is contained in:
parent
1d00634db8
commit
0693dd14d6
1 changed files with 14 additions and 0 deletions
14
src/main.ts
14
src/main.ts
|
|
@ -219,6 +219,20 @@ class TestReporter {
|
||||||
core.info(`Check run HTML: ${resp.data.html_url}`)
|
core.info(`Check run HTML: ${resp.data.html_url}`)
|
||||||
core.setOutput('url', resp.data.url)
|
core.setOutput('url', resp.data.url)
|
||||||
core.setOutput('url_html', resp.data.html_url)
|
core.setOutput('url_html', resp.data.html_url)
|
||||||
|
|
||||||
|
const {pull_request} = github.context.payload
|
||||||
|
|
||||||
|
if (pull_request) {
|
||||||
|
core.info('Attaching Test Summary as a comment to the PR')
|
||||||
|
|
||||||
|
const comment = `## Test Summary\n\n${summary}`
|
||||||
|
|
||||||
|
await this.octokit.rest.issues.createComment({
|
||||||
|
...github.context.repo,
|
||||||
|
issue_number: pull_request.number,
|
||||||
|
body: comment
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return results
|
return results
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue