Skip to content

fix: use correct SonarCloud project key #7

fix: use correct SonarCloud project key

fix: use correct SonarCloud project key #7

Workflow file for this run

name: SonarQube Code Analysis
on:
push:
branches: [ main, sonarqube-pipeline ]
pull_request:
branches: [ main ]
types: [ opened, synchronize, reopened ]
jobs:
sonarqube:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
issues: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for better analysis
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run ESLint (for SonarQube)
run: npm run lint || true
continue-on-error: true
# SonarQube Scan (works with both SonarCloud and self-hosted)
- name: SonarQube Scan
uses: sonarsource/sonarqube-scan-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL || 'https://sonarcloud.io' }}