Skip to content

Commit 6d9a722

Browse files
authored
Merge pull request #2 from green-code-initiative/setup-sonar-analysis
Add SonarCloud scan job
2 parents 400e414 + 5955de4 commit 6d9a722

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

.github/workflows/build.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,21 @@ jobs:
2828
run: yarn --cwd eslint-plugin lint
2929
- name: Test
3030
run: yarn --cwd eslint-plugin test:cov
31+
32+
sonarcloud:
33+
name: SonarCloud
34+
runs-on: ubuntu-latest
35+
36+
steps:
37+
- uses: actions/checkout@v3
38+
with:
39+
fetch-depth: 0
40+
- name: Install dependencies
41+
run: yarn --cwd eslint-plugin install --frozen-lockfile
42+
- name: Test
43+
run: yarn --cwd eslint-plugin test:cov
44+
- name: SonarCloud Scan
45+
uses: SonarSource/sonarcloud-github-action@master
46+
env:
47+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

sonar-project.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
sonar.organization=green-code-initiative
2+
sonar.projectKey=green-code-initiative_ecoCode-linter
3+
sonar.javascript.lcov.reportPaths=eslint-plugin/coverage/lcov.info

0 commit comments

Comments
 (0)