Skip to content

Update sonarcloud.yml #4

Update sonarcloud.yml

Update sonarcloud.yml #4

Workflow file for this run

name: SonarCloud Analysis
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
jobs:
build-and-analyze:
name: Build and Analyze with SonarCloud
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Setup .NET 6
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.x' # Ensuring compatibility with .NET 6
- name: Install SonarScanner for .NET
run: dotnet tool install --global dotnet-sonarscanner
- name: Begin SonarCloud Analysis
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: >
dotnet sonarscanner begin /k:"eziodevio" /o:"eziodevio"
/d:sonar.login="${{ secrets.SONAR_TOKEN }}"
/d:sonar.host.url="https://sonarcloud.io"
- name: Build Project
run: dotnet build
- name: End SonarCloud Analysis
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: dotnet sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"