yuzutech / annotations-action

GitHub action to create annotations from a JSON file
MIT License
31 stars 15 forks source link

Getting error `cause: HttpError: You must authenticate via a GitHub App.` #37

Closed tahirmt closed 2 years ago

tahirmt commented 2 years ago

Hi I'm getting an error cause: HttpError: You must authenticate via a GitHub App. when using this action.

My json file is like this

[{"file":"path/to/file","line":12,"title":"Some error title","message":"some error message","annotation_level":"failure"}]

Here is the log from the run

Run yuzutech/annotations-action@v0.3.0
  with:
    repo-token: ***
    input: ./annotations.json
    title: Build report
    ignore-unauthorized-error: false
    ignore-missing-file: true
Creating check {owner: '<owner>', repo: '<repo>', name: Report}
Error: GitHubApiError: Unable to create a check to '<owner>/<repo>' - cause: HttpError: You must authenticate via a GitHub App.

Am I missing something?

ggrossetie commented 2 years ago

Hello,

Maybe it's related to: https://github.com/yuzutech/annotations-action/issues/5

Usually this error indicates a permission issue. Check that your PAT has write access to the repository. Did you try with the built-in token repo-token: ${{ secrets.GITHUB_TOKEN }}? Are you trying to create annotations from a fork?

tahirmt commented 2 years ago

@Mogztter thank you for the answer. My personal access token has write access to the repo. I use it to make pushes in other workflows. The repo is a private repo which is not forked.

tahirmt commented 2 years ago

Looks like using the GitHub token works. Not sure what’s wrong with my personal access token then.

tahirmt commented 2 years ago

@Mogztter can I use start_line and end_line instead of line?

ggrossetie commented 2 years ago

@tahirmt Yes, it should work