Invoke SonarQube via GitHub action #3
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: SonarCloud Code Analysis | |
on: | |
pull_request: | |
types: | |
- opened | |
- synchronize | |
- reopened | |
push: | |
branches: | |
- main | |
- next | |
jobs: | |
sonarqube: | |
name: SonarQube | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Use Node.js 22.x | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
cache: "npm" | |
cache-dependency-path: "**/package-lock.json" | |
registry-url: "https://registry.npmjs.org" | |
- name: Install dependencies | |
run: npm ci && npm --prefix api ci && npm --prefix create-app ci && npm --prefix admin ci && npm --prefix site ci | |
- name: SonarQube Scan | |
uses: SonarSource/sonarqube-scan-action@v4 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} |