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

Option to opt-out from SARIF Report Upload #10

Closed
Akaame opened this issue Oct 30, 2022 · 9 comments · Fixed by #13
Closed

Option to opt-out from SARIF Report Upload #10

Akaame opened this issue Oct 30, 2022 · 9 comments · Fixed by #13
Labels
enhancement New feature or request

Comments

@Akaame
Copy link

Akaame commented Oct 30, 2022

Hello,

I have included this to my CI pipelines and have encountered the following error:

ERR Upload of Sarif Report GitHub yielded error error="POST https://api.github.com/repos/<org>/<repo>/code-scanning/sarifs: 403 Advanced Security must be enabled for this repository to use code scanning. 

Would it be possible to add an option to add the SARIF report to step outputs and opt-out from uploading the report?

@Templum
Copy link
Owner

Templum commented Oct 30, 2022

Sounds like a reasonable suggestion. Could you elaborate on how you would envision the opt-out to function?

@Templum Templum added the enhancement New feature or request label Oct 30, 2022
@Akaame
Copy link
Author

Akaame commented Oct 30, 2022

I was thinking of adding a fifth option to (either enum or bool) to denote the target as Code Scanning or Action Outputs (do not know if github.Client can do this) to instantiate GithubSarifUploader or a to-be GithubActionsUpload. I am not versed with action development so this is only a naive suggestion on my end.

@Templum
Copy link
Owner

Templum commented Oct 30, 2022

Actually, I was referring if you would expect to configure this via an additional input (like go-version) or by setting an env (which is currently done for Debug Logs)

@Templum Templum linked a pull request Nov 1, 2022 that will close this issue
@Templum Templum linked a pull request Nov 1, 2022 that will close this issue
@Templum
Copy link
Owner

Templum commented Nov 1, 2022

@Akaame I implemented your request, could you please give it a try. It's available under branch feature/10.

Here is an example configuration (I used that to verify):

  Code-Scan:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Scan for Vulnerabilities in Code
        uses: Templum/govulncheck-action@feature/10
        with:
          skip-upload: true
      - name: Upload Sarif Report
        uses: actions/upload-artifact@v3
        with:
          name: sarif-report
          path: govulncheck-report.sarif

@Templum
Copy link
Owner

Templum commented Nov 4, 2022

@Akaame did you get already a chance to test it out ?

@Templum
Copy link
Owner

Templum commented Nov 5, 2022

@Akaame I will let the issue open for another 3 Days, then the pr will be merged and issue closed. In case I hear not back

@Akaame
Copy link
Author

Akaame commented Nov 6, 2022

Seems perfect. Thanks for the effort 👍

@Templum
Copy link
Owner

Templum commented Nov 6, 2022

@Akaame glad that it works for you 👍

@Templum
Copy link
Owner

Templum commented Nov 6, 2022

Was released in v0.0.6

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

Successfully merging a pull request may close this issue.

2 participants