action-surefire-report icon indicating copy to clipboard operation
action-surefire-report copied to clipboard

Have the logs use the error annotation format

Open jamie-wearsafe opened this issue 3 years ago • 5 comments

https://github.com/ScaCap/action-surefire-report/blob/a915ba6359417544044fb06093a6c75097fe2a2b/utils.js#L101

If we use the issueCommand() function it will create error annotations in the action as well, which is also handy for accessing the problem.

core.issueCommand('error', {file: path,line:line}, `${message.replace(/\n/g, ' ')}`);

jamie-wearsafe avatar May 15 '21 21:05 jamie-wearsafe

Hey @jamie-wearsafe. I'm not really sure how does that work or what would it improve? Can you elaborate more on this?

jmisur avatar May 26 '21 11:05 jmisur

Hey @jamie-wearsafe. I'm not really sure how does that work or what would it improve? Can you elaborate more on this?

When using that annotation the error logs create links to the file and line number in the src. This way at the end of the job workflow, the items that are brought up in the report are also available as error annotations in the workflow.

jamie-wearsafe avatar May 29 '21 03:05 jamie-wearsafe

I'm unable to find such functionality in javascript core library though.

jmisur avatar Jun 07 '21 20:06 jmisur

I'm unable to find such functionality in javascript core library though.

Its here: https://github.com/actions/toolkit/blob/45647689407e7fb224e06d066dde6aefa67a365f/packages/core/src/command.ts#L23

jamie-wearsafe avatar Jul 13 '21 19:07 jamie-wearsafe

It's intended for internal use. I'd rather stick to official API.

jmisur avatar Aug 17 '21 12:08 jmisur