Skip to content

Commit 5e5dbc5

Browse files
committed
ci: Enhance SonarCloud workflow by adding a cache name for node modules and a fallback for SONAR_TOKEN.
1 parent 28ef564 commit 5e5dbc5

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

.github/workflows/sonarcloud.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ jobs:
1010
sonarcloud:
1111
name: SonarCloud
1212
runs-on: ubuntu-latest
13+
env:
14+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
1315

1416
steps:
1517
# Checkout
@@ -21,6 +23,8 @@ jobs:
2123
- name: Cache node modules
2224
id: cache-npm
2325
uses: actions/cache@v3
26+
env:
27+
cache-name: cache-node-modules
2428
with:
2529
path: ~/.npm
2630
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
@@ -44,5 +48,4 @@ jobs:
4448
- name: SonarCloud Scan
4549
uses: SonarSource/[email protected]
4650
env:
47-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
48-
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
51+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)