41 lines
1.1 KiB
YAML
41 lines
1.1 KiB
YAML
name: SonarQube Analysis
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
project_key:
|
|
type: string
|
|
required: true
|
|
wait_for_quality_gate:
|
|
type: string
|
|
required: false
|
|
default: 'false'
|
|
|
|
secrets:
|
|
SONAR_HOST_URL:
|
|
required: true
|
|
SONAR_TOKEN:
|
|
required: true
|
|
|
|
jobs:
|
|
sonarqube:
|
|
runs-on: ubuntu-latest
|
|
|
|
container:
|
|
image: sonarsource/sonar-scanner-cli:12.0.0.3214_8.0.1
|
|
options: --user root
|
|
|
|
steps:
|
|
- name: Checkout Code
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Run SonarQube Scan
|
|
run: |
|
|
sonar-scanner \
|
|
-Dsonar.projectKey=${{ inputs.project_key }} \
|
|
-Dsonar.projectName=${{ inputs.project_key }} \
|
|
-Dsonar.sources=. \
|
|
-Dsonar.host.url=${{ secrets.SONAR_HOST_URL }} \
|
|
-Dsonar.token=${{ secrets.SONAR_TOKEN }} \
|
|
-Dsonar.exclusions=node_modules/**,dist/**,coverage/** \
|
|
-Dsonar.qualitygate.wait=${{ inputs.wait_for_quality_gate == true || inputs.wait_for_quality_gate == 'true' }} |