Skip to content

source-root is not applied in SARIF output #1147

Open
@meriouma

Description

@meriouma

I'm not sure if I got the doc wrong, but I have a project with multiple folders and when running CodeQL on a single sub-folder using source-root like this :

runs:
  using: composite
  steps:
    - name: Initialize CodeQL
      uses: github/codeql-action/init@v2
      with:
        languages: ${{ inputs.languages }}
        source-root: packages/react

    - name: Perform CodeQL Analysis
      uses: github/codeql-action/analyze@v2
      with:
        category: ${{ inputs.category }}
        checkout_path: packages/react # Tried with or without this

In the sarif output, the artifactLocation.uri properties are relative to packages/react, which once uploaded to Github code scanning, yields invalid paths in the repository, as they are relative from the source-root, instead of the repository root.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions