Skip to content

Commit

Permalink
ci: updated steps.dotnet-build-test.yml
Browse files Browse the repository at this point in the history
Skip SonarCloud Scan if the pull request is from a forked repository

Signed-off-by: SebastienDegodez <[email protected]>
  • Loading branch information
SebastienDegodez committed Dec 21, 2024
1 parent 9467979 commit 4ceb187
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/steps.dotnet-build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ jobs:
run: dotnet restore

- name: 🔍 Start SonarQube Analysis
if: ${{ inputs.use-sonarcloud == true && github.repository == 'microcks/microcks-testcontainers-dotnet' }}
# Skip SonarCloud Scan if the pull request is from a forked repository
if: ${{ inputs.use-sonarcloud == true && ((github.repository == 'microcks/microcks-testcontainers-dotnet' && github.event_name != 'pull_request') ||(github.event.pull_request.head.repo.full_name == github.repository && github.event_name == 'pull_request')) }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
Expand Down Expand Up @@ -99,7 +100,8 @@ jobs:
shell: pwsh

- name: Stop SonarQube Analysis
if: ${{ inputs.use-sonarcloud == true && (success() || steps.test-with-coverage.conclusion == 'failure') && github.repository == 'microcks/microcks-testcontainers-dotnet' }}
# Skip SonarCloud Scan if the pull request is from a forked repository
if: ${{ inputs.use-sonarcloud == true && (success() || steps.test-with-coverage.conclusion == 'failure') && ((github.repository == 'microcks/microcks-testcontainers-dotnet' && github.event_name != 'pull_request') || (github.event.pull_request.head.repo.full_name == github.repository && github.event_name == 'pull_request')) }}
id: sonar
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down

0 comments on commit 4ceb187

Please sign in to comment.