Skip to content

Invoke SonarQube via GitHub action #1

Invoke SonarQube via GitHub action

Invoke SonarQube via GitHub action #1

Workflow file for this run

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 20.x
uses: actions/setup-node@v3
with:
node-version: 20
registry-url: "https://registry.npmjs.org"
cache: "yarn" # https://github.com/actions/setup-node/blob/main/docs/advanced-usage.md#caching-packages-dependencies
- run: yarn install
- name: SonarQube Scan
uses: SonarSource/sonarqube-scan-action@v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}