Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Report the output via GitHub annotations #51

Closed
ZehMatt opened this issue Sep 17, 2022 · 3 comments · Fixed by #71
Closed

Report the output via GitHub annotations #51

ZehMatt opened this issue Sep 17, 2022 · 3 comments · Fixed by #71
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@ZehMatt
Copy link

ZehMatt commented Sep 17, 2022

The comments unfortunately introduce a lot of noise and GitHub has a way to make the reporting a bit better.

Example: https://github.com/golangci/golangci-lint-action#golangci-lint-action

This is achieved with https://github.com/actions/toolkit/blob/main/docs/problem-matchers.md

@ZedThree
Copy link
Owner

Very happy to add this as an option (PRs welcome!), but it does have two downsides:

  1. limited number of annotations
  2. I don't think you can use the fixits as suggestions

I also wasn't sure if actions could create annotations when I first wrote this, but it seems it is now possible

@ZehMatt
Copy link
Author

ZehMatt commented Sep 21, 2022

I think having it as an alternative option to comments would be great.

@ZedThree ZedThree added enhancement New feature or request help wanted Extra attention is needed labels Oct 14, 2022
@ZedThree
Copy link
Owner

I'm going to release this in v0.12 now, as I won't have much time to improve this for a while. PRs to make this feature better are more than welcome!

For future reference, the check-runs REST API, which is how to use annotations, is documented here: https://docs.github.com/en/rest/checks/runs?apiVersion=2022-11-28#create-a-check-run

Although locally, one must have a GitHub App Installation Token to post annotations, as the fine-grained PAT just doesn't have access to it, it turns out that the GITHUB_TOKEN in the Action does have access, which is why this works without having to create a whole GitHub App

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants