Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Copilot Lvl 3
Message 1 of 7

What are annotations?

Solved! Go to Solution.

In the email reports when my Workflow fails, I see mentions of annotations, like "$xyz succeeded (0 annotations)".

 

What are annotations? The search bar on help.github.com doesn't show any relevant results.

6 Replies
Solution
GitHub Staff
Message 2 of 7

Re: What are annotations?

Ahh, that email is confusing.

 

https://help.github.com/en/articles/about-status-checks

 

See the comments on the lines of code? That's an annotation. We have an API that allows annotations to be created during a CI run.

 

checks-detailed

 

They aren't supported in Actions yet, but will be.

Pilot Lvl 1
Message 3 of 7

Re: What are annotations?

@mscoutermarsh any idea when annotations will be supported again? I have a couple actions that need to be migrated to v2 that do this but I'm unable to create annotations with v2 actions. I can run v1 action in a v2 workflow and annotations will be created just fine, but a v2 style action doesn't. I can create the checks run, but when I try to update it with the annotations I get a 422 response.

Copilot Lvl 3
Message 4 of 7

Re: What are annotations?

I have had some success (kind of) for adding annotations:

 

  1. Try to get the current check run by listing all the checks that are `in_progress` and then finding the current run. I wrote this helper. (In this case I can make some assumptions like that the name contains "test" -  your may not. In my case I also could have returned the only check run that is in progress because I know that only one would be running)
  2. Create the annotations. I am using my jest output.
  3. Updating the check run found in 1.

 

With this method I can add annotations:

Bildschirmfoto 2019-09-12 um 22.44.06.png

 

The real downside is, that annotation can only be viewed in files changed with the commit:

Bildschirmfoto 2019-09-12 um 22.48.36.png

... So because I wanted to add the test results directly to the failing test, I am out of luck when a test fails which has not been changed with the current commit.

 

Hopefully the code samples are helpful for you.

Pilot Lvl 1
Message 5 of 7

Re: What are annotations?

I see when my check run is running the status is from 'queued' to 'completed'. I dont see 'in_progress'. Any thoughts what I am missing ?

Pilot Lvl 1
Message 6 of 7

Re: What are annotations?

How can I add annotations to my npm test workflow which I have created?

 

My response after running the test:

 

```
[ { path: '.github/workflows/test.yml',
blob_href: 'repo...../.github/workflows/test.yml',
start_line: 1,
start_column: null,
end_line: 1,
end_column: null,
annotation_level: 'failure',
title: '.github/workflows/test.yml#L1',
message: 'Process completed with exit code 1.',
raw_details: null } ]

```

Ground Controller Lvl 1
Message 7 of 7

Re: What are annotations?

Any update on this, or when the feature might be available?