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
33
44on :
55 push :
6- branches : ["main"]
7- pull_request :
8- branches : ["main"]
96
107jobs :
118 build :
129 runs-on : ubuntu-latest
1310
1411 steps :
1512 - uses : actions/checkout@v4
13+ with :
14+ fetch-depth : 0
1615
1716 - name : Use Node.js
1817 uses : actions/setup-node@v4
2221
2322 - run : npm ci
2423 - 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