Skip to content

TEST: Attempt to open PR from a fork and NOT fail sonarcloud workflows #119

TEST: Attempt to open PR from a fork and NOT fail sonarcloud workflows

TEST: Attempt to open PR from a fork and NOT fail sonarcloud workflows #119

name: Client SonarCloud
on:
workflow_dispatch:
pull_request:
branches:
- main
paths:
- "client/src/js/**"
- "client/src/css/**"
- "client/src/serviceWorker.js"
- ".github/workflows/client-sonarcloud.yml"
push:
branches:
- main
paths:
- "client/src/js/**"
- "client/src/css/**"
- "client/src/serviceWorker.js"
- ".github/workflows/client-sonarcloud.yml"
permissions:
pull-requests: read # allows SonarCloud to decorate PRs with analysis results
jobs:
SonarCloudAnalysis-Client:
name: SonarCloud Analysis client
runs-on: ubuntu-latest
if: github.event.pull_request.head.repo.fork == false
steps:
# Checkout the repo
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
# Analyze client with SonarCloud
- name: Analyze client with SonarCloud
uses: SonarSource/sonarcloud-github-action@v2.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN_CLIENT }}
with:
projectBaseDir: ./client/src
# Additional arguments for the sonarcloud scanner
args: -Dsonar.projectKey=nuwcdivnpt_stig-manager-client
-Dsonar.projectName=nuwcdivnpt_stig-manager-client
-Dsonar.organization=nuwcdivnpt
-Dsonar.inclusions=**/*.js,**/*.html,**/*.css
-Dsonar.exclusions=**/node_modules/**