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

Code scanning alert doesn't find file in repository #34

Closed
adangel opened this issue Dec 20, 2021 · 1 comment · Fixed by #36
Closed

Code scanning alert doesn't find file in repository #34

adangel opened this issue Dec 20, 2021 · 1 comment · Fixed by #36
Labels
bug Something isn't working
Milestone

Comments

@adangel
Copy link
Member

adangel commented Dec 20, 2021

When uploading the SARIF file to code-ql, the file in the repository is not found:

Preview unavailable

Sorry, we couldn't find this file in the repository.

grafik


Workaround

Add the following step before upload-sarif:

      - name: Relativize SARIF
        shell: bash
        run: |
          jq ".runs[0].results[].locations[].physicalLocation.artifactLocation.uri |= sub(\"${GITHUB_WORKSPACE}/\"; \"\")" pmd-report.sarif > pmd-report2.sarif
          mv -f pmd-report2.sarif pmd-report.sarif
@adangel adangel added the bug Something isn't working label Dec 20, 2021
@adangel
Copy link
Member Author

adangel commented Dec 20, 2021

It seems, that the upload-sarif actions actually has a parameter for this: https://github.com/github/codeql-action/blob/249c7ffce1bd9ae683a22f2e0b82253a31562477/upload-sarif/action.yml#L12-L15

However, checkout_path doesn't seem to be working as expected... so we simply relativize the paths ourselves (as we did already for the build annotations).

@adangel adangel added this to the next milestone Dec 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant