Skip to content

feat: sonarscanner-dotnet#182

Open
aahmed-dfe wants to merge 7 commits into
DFE-Digital:masterfrom
aahmed-dfe:aa/sonar-scanner
Open

feat: sonarscanner-dotnet#182
aahmed-dfe wants to merge 7 commits into
DFE-Digital:masterfrom
aahmed-dfe:aa/sonar-scanner

Conversation

@aahmed-dfe

@aahmed-dfe aahmed-dfe commented Jun 5, 2026

Copy link
Copy Markdown

Context

Introduce a reusable GitHub composite action for running SonarCloud analysis on .NET applications.

This replaces the need for each repository to configure SonarScanner setup, SDK handling, Java setup, and begin/build/end wrapping individually.

As EducationProviderRegistry has 3 repositories that will use Sonar, this seemed a good time to do this. We have a working example on GetInformationAboutPupils.

There are many dotnet projects that consume the cli scanner in DFE-Digital

Changes proposed in this pull request

## Example consumer

- name: SonarCloud scan
  uses: DFE-Digital/github-actions/sonarscan-dotnet@main
  with:
    sonarcloud-project-key: your_project_key
    sonarcloud-token: ${{ secrets.SONAR_TOKEN }}
    coverage-report-path: merged-coverage-reports/SonarQube.xml

Guidance to review

Example consumer on GIAP

image

After merging

[] Adopt across other projects
[] Java17 deprecation warning from July 26...

Checklist

  • I have performed a self-review of my code, including formatting and typos
  • I have cleaned the commit history
  • I have added the Devops label
  • I have attached the pull request to the trello card

@aahmed-dfe aahmed-dfe changed the title feat: dotnet-sonarscanner feat: sonarscanner-dotnet Jun 5, 2026
Comment thread sonarscan-dotnet/action.yaml Outdated
/o:"${{ inputs.sonarcloud-organisation }}" \
/k:"${{ inputs.sonarcloud-project-key }}" \
/d:sonar.host.url="${{ inputs.sonarcloud-url }}" \
/d:sonar.token="${{ inputs.sonarcloud-token }}" \

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worth checking if we can add ::add-mask:: for the token as a precaution, consistent with how other actions in this repo handle secrets e.g. fix-airbyte-lsn.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aahmed-dfe aahmed-dfe Jun 9, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be worth documenting recommended patterns in a CODING_STANDARDS or equivalent for future actions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants