Skip to content

DynamicsValue/dotnet-sonarscanner

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dotnet-sonarscanner

dotnet-sonarscanner GitHub Action.

Currently does not support username/password authentication and presumes you are using tokens. Open to changing this, if required.

Usage example

- name: Sonarscanner for dotnet
  uses: Secbyte/[email protected]
  with:
    restoreCommand: dotnet restore .
    buildCommand: dotnet build .
    testCommand: dotnet test .
    projectKey: a-project-key
    projectName: a-project-name
    sonarOrganisation: an-org
    beginArguments: >
        /d:sonar.verbose="true"
        /d:sonar.cs.opencover.reportsPaths='"/path/to/coverage.xml","/path/to/coverage.2.xml"'
        /d:sonar.coverage.exclusions='"**/*.cs","**/*.md"'
  env:
    SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
    GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Inputs

restoreCommand:
  description: "Command to invoke to restore packages. Optional"
  required: false
buildCommand:
  description: "Command to invoke build"
  required: true
testCommand:
  description: "Command to invoke tests"
  required: false
projectKey:
  description: "Specifies the key of the analyzed project in SonarQube"
  required: true
projectName:
  description: "Specifies the name of the analyzed project in SonarQube"
  required: true
sonarHostname:
  description: "The server URL"
  default: "https://sonarcloud.io"
  required: false
sonarOrganisation:
  description: "Organisation"
  required: true
beginArguments:
  description: "Arguments to append to the begin command"
  required: false
endArguments:
  description: "Arguments to append to the end command"
  required: false

Environment variables

  • SONAR_TOKEN - Token from SonarCloud with ExecuteAnalysis permissions
  • GITHUB_TOKEN - GitHub Token

Full dotnet docker images tags:

https://mcr.microsoft.com/v2/dotnet/sdk/tags/list

About

dotnet sonarscanner GitHub Action

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell 53.0%
  • Dockerfile 47.0%