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

Annotations support #244

Open
MPV opened this issue Oct 30, 2023 · 1 comment
Open

Annotations support #244

MPV opened this issue Oct 30, 2023 · 1 comment

Comments

@MPV
Copy link

MPV commented Oct 30, 2023

Hi,
Would you consider adding support for Annotations?

See for comparison:

@kzantow
Copy link
Contributor

kzantow commented Sep 19, 2024

Hi @MPV, apologies for the delay getting back to you on this issue.

We talked about this on our livestream today, but it was a little unclear what you were hoping to accomplish, so I thought I would get a little more information and suggest something that you could do today, based on a few assumptions.

The GitHub annotations support specifying a file and line, but Grype does not capture line numbers where packages were found. It does capture files, so it would be possible to associate a vulnerability in the list to a file, but it seems like you may have just been looking for a way to show the vulnerability report in a more convenient location. If that's the case, the GitHub summary is a pretty good way to go. You could store the table output to a file, and include it in the top-level workflow like this:

      - uses: anchore/scan-action@main
        with:
          image: alpine:3.15
          fail-build: false
          output-format: table
        env:
          GRYPE_FILE: vuln-report.out

      - run: |
          VULN_REPORT="$(cat vuln-report.out)"
          printf "# Vulnerability Report Summary\n<pre>$VULN_REPORT</pre>" > $GITHUB_STEP_SUMMARY

... which results in the table output being printed right at the summary view of the workflow:
image

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

No branches or pull requests

2 participants