We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4575336 commit 403faeeCopy full SHA for 403faee
1 file changed
.github/workflows/sonar.yml
@@ -24,10 +24,22 @@ env:
24
SONARCLOUD_HOST: https://sonarcloud.io
25
26
jobs:
27
+ token-check:
28
+ runs-on: ubuntu-latest
29
+ outputs:
30
+ hasToken: ${{ steps.check-token.outputs.has }}
31
+ steps:
32
+ - id: check-token
33
+ run: |
34
+ [ -z $SONAR_TOKEN ] && echo "has=false" || echo "has=true" >> "$GITHUB_OUTPUT"
35
+ env:
36
+ SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
37
+
38
sonar:
39
name: SonarCloud Scan
40
runs-on: ubuntu-latest
- if: ${{ !(github.event_name == 'pull_request' && startsWith(github.head_ref, 'renovate/')) && secrets.SONAR_TOKEN != '' }}
41
+ needs: token-check
42
+ if: ${{ !(github.event_name == 'pull_request' && startsWith(github.head_ref, 'renovate/')) && needs.token-check.outputs.hasToken }}
43
steps:
44
- uses: actions/checkout@v4
45
with:
0 commit comments