Skip to content

Commit

Permalink
- use core to define the annotations
Browse files Browse the repository at this point in the history
  - FIX #514
  • Loading branch information
mikepenz committed Mar 18, 2022
1 parent 127c778 commit 0d2f2b5
Show file tree
Hide file tree
Showing 3 changed files with 91 additions and 25 deletions.
94 changes: 70 additions & 24 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,25 @@ export async function run(): Promise<void> {
core.startGroup(`🚀 Publish results`)

try {
for (const annotation of testResult.annotations) {
const properties: core.AnnotationProperties = {
title: annotation.title,
file: annotation.path,
startLine: annotation.start_line,
endLine: annotation.end_line,
startColumn: annotation.start_column,
endColumn: annotation.end_column
}
if (annotation.annotation_level === 'failure') {
core.error(annotation.message, properties)
} else if (annotation.annotation_level === 'warning') {
core.warning(annotation.message, properties)
} else {
core.notice(annotation.message, properties)
}
}

/*
const octokit = github.getOctokit(token)
if (updateCheck) {
Expand Down Expand Up @@ -138,6 +157,7 @@ export async function run(): Promise<void> {
core.info(`ℹ️ Creating check`)
await octokit.rest.checks.create(createCheckRequest)
}
*/

if (failOnFailure && conclusion === 'failure') {
core.setFailed(`❌ Tests reported ${failed} failures`)
Expand Down

0 comments on commit 0d2f2b5

Please sign in to comment.