File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1010jobs :
1111 sonarcloud :
1212 runs-on : ubuntu-latest
13+ environment : org-prod
1314 permissions :
15+ id-token : write
1416 contents : read
1517 pull-requests : write
1618 steps :
1719 - uses : actions/checkout@v6
1820 with :
1921 fetch-depth : 0
2022
23+ - name : Azure login (OIDC)
24+ uses : azure/login@v2
25+ with :
26+ client-id : ${{ vars.AZURE_CLIENT_ID }}
27+ tenant-id : ${{ vars.AZURE_TENANT_ID }}
28+ subscription-id : ${{ vars.AZURE_SUBSCRIPTION_ID }}
29+
30+ - name : Read SonarCloud token from Key Vault
31+ shell : bash
32+ run : |
33+ SONAR_TOKEN="$(az keyvault secret show \
34+ --vault-name "${{ vars.AZURE_KEYVAULT_NAME }}" \
35+ --name "sonar-cloud-token" \
36+ --query value -o tsv)"
37+ if [ -z "${SONAR_TOKEN}" ]; then
38+ echo "Key Vault secret sonar-cloud-token is empty."
39+ exit 1
40+ fi
41+ echo "::add-mask::$SONAR_TOKEN"
42+ echo "SONAR_TOKEN=$SONAR_TOKEN" >> "$GITHUB_ENV"
43+
2144 - uses : actions/setup-python@v6
2245 with :
2346 python-version : ' 3.12'
3255 uses : SonarSource/sonarcloud-github-action@ffc3010689be73b8e5ae0c57ce35968afd7909e8
3356 env :
3457 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
35- SONAR_TOKEN : ${{ secrets .SONAR_TOKEN }}
58+ SONAR_TOKEN : ${{ env .SONAR_TOKEN }}
3659 with :
3760 args : >
3861 -Dsonar.host.url=https://sonarcloud.io
4770 with :
4871 scanMetadataReportFile : dist/quality/sonar/scannerwork/report-task.txt
4972 env :
50- SONAR_TOKEN : ${{ secrets .SONAR_TOKEN }}
73+ SONAR_TOKEN : ${{ env .SONAR_TOKEN }}
5174 SONAR_HOST_URL : https://sonarcloud.io
5275 timeout-minutes : 5
You can’t perform that action at this time.
0 commit comments