File tree Expand file tree Collapse file tree 1 file changed +20
-3
lines changed Expand file tree Collapse file tree 1 file changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -3,16 +3,15 @@ name: Build static docs
3
3
4
4
on :
5
5
push :
6
- branches : ["main"]
7
- pull_request :
8
- branches : ["main"]
9
6
10
7
jobs :
11
8
build :
12
9
runs-on : ubuntu-latest
13
10
14
11
steps :
15
12
- uses : actions/checkout@v4
13
+ with :
14
+ fetch-depth : 0
16
15
17
16
- name : Use Node.js
18
17
uses : actions/setup-node@v4
22
21
23
22
- run : npm ci
24
23
- run : npm run build --if-present
24
+
25
+ - name : Get Project Version from Git Tag
26
+ id : get_version
27
+ run : |
28
+ # Use 'git describe' to find the closest tag, falling back to the commit SHA if no tag is found.
29
+ # --tags includes all tags, --always ensures it always outputs something.
30
+ VERSION=$(git describe --tags --always)
31
+ echo "Project version is $VERSION"
32
+ echo "tag=$VERSION" >> $GITHUB_OUTPUT
33
+
34
+ - name : SonarQube Analysis (Branch)
35
+ uses : SonarSource/sonarqube-scan-action@v6
36
+ env :
37
+ SONAR_TOKEN : ${{ secrets.SONAR_TOKEN }}
38
+ SONAR_HOST_URL : ${{ secrets.SONAR_HOST_URL }}
39
+ with :
40
+ args : >
41
+ -Dsonar.projectVersion=${{ steps.get_version.outputs.tag }}
You can’t perform that action at this time.
0 commit comments