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

Can annotations be shown to PRs on each commit on code? #43

Open
tsigouris007 opened this issue Sep 3, 2021 · 4 comments
Open

Can annotations be shown to PRs on each commit on code? #43

tsigouris007 opened this issue Sep 3, 2021 · 4 comments

Comments

@tsigouris007
Copy link

My scenario is that I have integrated a static code analysis tool that produces a json file in the format needed for this action to work.
Sample of my action:

      - name: Beautify + create annotations result
        run: |
          ruby parser.rb -f ${{env.TMPFILE}}
          ruby annotate.rb -f ${{env.OUTFILE}} -o ./annotations.json
      - name: Annotate
        uses: yuzutech/[email protected]
        with:
          repo-token: ${{secrets.GITHUB_TOKEN}}
          input: ./annotations.json
          title: 'Findings'
          ignore-missing-file: true

The annotations are displayed perfectly on the action page such as:
ksnip_20210903-133500

But when clicking on the finding nothing gets displayed on the file anywhere I looked for (main PR page, commit page, files changed page). If a specific line has changed during the last commit it works, but on then next push if the line does not get changed the failure message is not shown again.
First push with changed line:
ksnip_20210903-134036

Second push with unchanged line (yet still finding in the job):
ksnip_20210903-134325

Is there an option to maintain all findings even if not lines are changed on next commits such as this one according to my annotations.json file? Or even better to maintain all annotations on files changed?

Thank you!

@sfc-gh-nlele
Copy link

+1 on this, any way to solve this would be really appreciated!

@ggrossetie
Copy link
Member

I think this is a limitation of the GitHub annotations feature/API.
See: #19 (comment)

You should ask GitHub support: https://support.github.com/

@ggrossetie
Copy link
Member

Also related to #4

@ggrossetie
Copy link
Member

It seems that we can now create annotation from the logger: https://github.com/actions/toolkit/tree/main/packages/core#annotations
I don't think we will get a different result but I can try to create annotations using core.error, core.warning and core.notice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants