Skip to content

feat: react scan

feat: react scan #1916

Workflow file for this run

name: SonarCloud Scan
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
merge_group:
jobs:
sonarcloud:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup pnpm
uses: pnpm/action-setup@v3
with:
version: 8
- name: Setup Node 20
uses: actions/setup-node@v4
with:
node-version: 20
cache: "pnpm"
- name: Install deps (with cache)
run: pnpm install
- name: Inject Doppler env vars
uses: dopplerhq/[email protected]
id: doppler
with:
doppler-token: ${{ secrets.DOPPLER_TOKEN }}
inject-env-vars: true
- name: Get App Version
id: app-version
run: |
APP_VERSION=$(grep -m 1 -oP '(?<=## \[)\d+\.\d+\.\d+' CHANGE_LOG.md)
echo "version=$APP_VERSION" >> $GITHUB_OUTPUT
- name: SonarCloud scan
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ steps.doppler.outputs.SONAR_TOKEN }}
with:
args: >
-Dsonar.projectVersion=${{ steps.app-version.outputs.version }}