File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change 10
10
runs-on : ubuntu-latest
11
11
if : github.event.workflow_run.conclusion == 'success'
12
12
steps :
13
- - uses : actions/checkout@v2
13
+ - uses : actions/checkout@v3
14
14
with :
15
- fetch-depth : 0 # Shallow clones should be disabled for a better relevancy of analysis
15
+ ref : ${{ github.event.workflow_run.head_sha }} # checkout commit that triggered this workflow
16
+ fetch-depth : 0 # Shallow clones should be disabled for a better relevancy of analysis
17
+
18
+ # fetch develop so that Sonar can identify new issues in PR builds
19
+ - name : Fetch develop
20
+ if : " github.event.workflow_run.head_branch != 'develop'"
21
+ run : git rev-parse HEAD && git fetch origin develop:develop && git status && git rev-parse HEAD
16
22
17
23
# There's a 'download artifact' action, but it hasn't been updated for the workflow_run action
18
24
# (https://github.com/actions/download-artifact/issues/60) so instead we get this mess:
40
46
- name : Extract Coverage Report
41
47
run : unzip -d coverage coverage.zip && rm coverage.zip
42
48
49
+ - name : Read version
50
+ id : version
51
+ uses : WyriHaximus/github-action-get-previous-tag@v1
52
+
43
53
- name : SonarCloud Scan
44
54
uses : SonarSource/sonarcloud-github-action@master
55
+ with :
56
+ args : >
57
+ -Dsonar.projectVersion=${{ steps.version.outputs.tag }}
58
+ -Dsonar.scm.revision=${{ github.event.workflow_run.head_sha }}
45
59
env :
46
60
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
47
61
SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
Original file line number Diff line number Diff line change @@ -12,3 +12,5 @@ sonar.typescript.tsconfigPath=./tsconfig.json
12
12
sonar.javascript.lcov.reportPaths =coverage/lcov.info
13
13
sonar.coverage.exclusions =spec/**/*
14
14
sonar.testExecutionReportPaths =coverage/test-report.xml
15
+
16
+ sonar.lang.patterns.ts =**/*.ts,**/*.tsx
You can’t perform that action at this time.
0 commit comments