Skip to content

Commit 1fba24a

Browse files
committed
Switch sonar:check to use SONAR_TOKEN from the environment
1 parent 12b2fc8 commit 1fba24a

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

.github/workflows/report.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ jobs:
3636
run: poetry run -- nox -s project:report -- --format json | tee metrics.json
3737

3838
- name: Upload to sonar
39-
run: poetry run -- nox -s sonar:check -- ${{ secrets.SONAR_TOKEN }}
39+
env:
40+
SONAR_TOKEN: "${{ secrets.SONAR_TOKEN }}"
41+
run: poetry run -- nox -s sonar:check
4042

4143
- name: Upload Artifacts
4244
uses: actions/[email protected]

doc/changes/unreleased.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
11
# Unreleased
2+
3+
## Security
4+
* #477: Switched `sonar:check` to use `SONAR_TOKEN` from the environment

exasol/toolbox/nox/_artifacts.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import json
2+
import os
23
import re
34
import shutil
45
import sqlite3
@@ -208,6 +209,6 @@ def _upload_to_sonar(session: Session, sonar_token: str, config: Config) -> None
208209
@nox.session(name="sonar:check", python=False)
209210
def upload_artifacts_to_sonar(session: Session) -> None:
210211
"""Upload artifacts to sonar for analysis"""
211-
sonar_token = session.posargs[0]
212+
sonar_token = os.getenv("SONAR_TOKEN")
212213
_prepare_coverage_xml(session, PROJECT_CONFIG.source)
213214
_upload_to_sonar(session, sonar_token, PROJECT_CONFIG)

exasol/toolbox/templates/github/workflows/report.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ jobs:
3333
run: poetry run -- nox -s artifacts:validate
3434

3535
- name: Upload to sonar
36-
run: poetry run -- nox -s sonar:check -- ${{ secrets.SONAR_TOKEN }}
36+
env:
37+
SONAR_TOKEN: "${{ secrets.SONAR_TOKEN }}"
38+
run: poetry run -- nox -s sonar:check
3739

3840
- name: Generate Report
3941
run: poetry run -- nox -s project:report -- --format json | tee metrics.json

0 commit comments

Comments
 (0)