diff --git a/.gitea/workflows/sonarqube.yml b/.gitea/workflows/sonarqube.yml new file mode 100644 index 0000000..4320267 --- /dev/null +++ b/.gitea/workflows/sonarqube.yml @@ -0,0 +1,32 @@ +name: SonarQube + +on: + workflow_dispatch: + +jobs: + sonarqube: + name: SonarQube + runs-on: build-htz-01 + steps: + - name: Checkout Code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Create Valid Project Key + id: sonar_setup + run: | + CLEAN_KEY=$(echo "${{ gitea.repository }}" | tr '/' ':') + echo "key=$CLEAN_KEY" >> $GITHUB_OUTPUT + + - name: SonarQube Scan + uses: sonarsource/sonarqube-scan-action@master + continue-on-error: true + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} + with: + args: > + -Dsonar.projectKey=${{ steps.sonar_setup.outputs.key }} + -Dsonar.projectName=${{ gitea.repository }} + -Dsonar.qualitygate.wait=true \ No newline at end of file