diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index 114e07b..3e37b10 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -20,6 +20,7 @@ jobs: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 with: fetch-depth: 0 + persist-credentials: false - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6 with: @@ -39,7 +40,7 @@ jobs: - name: Azure login (OIDC) if: ${{ github.event_name != 'pull_request' || (github.event.pull_request.head.repo.fork == false && contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.pull_request.author_association)) }} - uses: azure/login@a457da9ea143d694b1b9c7c869ebb04ebe844ef5 + uses: azure/login@532459ea530d8321f2fb9bb10d1e0bcf23869a43 with: client-id: ${{ vars.AZURE_CLIENT_ID }} tenant-id: ${{ vars.AZURE_TENANT_ID }} @@ -48,11 +49,13 @@ jobs: - name: Read SonarCloud token from Key Vault if: ${{ github.event_name != 'pull_request' || (github.event.pull_request.head.repo.fork == false && contains(fromJSON('["OWNER","MEMBER","COLLABORATOR"]'), github.event.pull_request.author_association)) }} id: sonar_token + env: + AZURE_KEYVAULT_NAME: ${{ vars.AZURE_KEYVAULT_NAME }} shell: bash run: | set -euo pipefail SONAR_TOKEN="$(az keyvault secret show \ - --vault-name "${{ vars.AZURE_KEYVAULT_NAME }}" \ + --vault-name "$AZURE_KEYVAULT_NAME" \ --name "sonar-cloud-token" \ --query value -o tsv)" if [ -z "${SONAR_TOKEN}" ]; then