-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (45 loc) · 1.27 KB
/
sonarcloud.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
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 }}