Skip to content

Commit a97e9ef

Browse files
committed
CQ: Avoid expanding secrets in a run block
1 parent 2925330 commit a97e9ef

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,9 @@ jobs:
179179
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
180180
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
181181
shell: powershell
182+
env:
183+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
182184
run: |
183-
.\.sonar\scanner\dotnet-sonarscanner begin /k:"abhinavminhas_QueryDB" /o:"abhinavminhas" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io"
185+
.\.sonar\scanner\dotnet-sonarscanner begin /k:"abhinavminhas_QueryDB" /o:"abhinavminhas" /d:sonar.token="$SONAR_TOKEN" /d:sonar.host.url="https://sonarcloud.io"
184186
dotnet build
185-
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"
187+
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.token="$SONAR_TOKEN"

.github/workflows/code-quality.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ jobs:
3939
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4040
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
4141
shell: powershell
42+
env:
43+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
4244
run: |
43-
.\.sonar\scanner\dotnet-sonarscanner begin /k:"abhinavminhas_QueryDB" /o:"abhinavminhas" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io"
45+
.\.sonar\scanner\dotnet-sonarscanner begin /k:"abhinavminhas_QueryDB" /o:"abhinavminhas" /d:sonar.token="$SONAR_TOKEN" /d:sonar.host.url="https://sonarcloud.io"
4446
dotnet build
45-
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"
47+
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.token="$SONAR_TOKEN"

0 commit comments

Comments
 (0)