Ignore Files In Quality Scan Using Github Actions

Summary

  • GitHub
  • Github Actions
  • .net core 3.1

How can we exclude folders from a scan for instance a Migrations folder using github actions?

Kind Regards
J

Hey there.

Are you following the tutorial in the SonarCloud UI for GitHub Actions + .NET?

If so, you can just add parameters from the Narrowing the Focus docs to the begin command.

......
run: |
.\.sonar\scanner\dotnet-sonarscanner begin .... /d:sonar.exclusions="**/Migrations/**"
<your clean build command>
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"

You can also set exclusions under the Analysis Scope Administration section of your project in SonarCloud.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.