Skip to content

Commit

Permalink
fix: make sure sonar only runs if sonar_token is set
Browse files Browse the repository at this point in the history
  • Loading branch information
favna committed Sep 24, 2024
1 parent 82ca8fe commit 0bb9d34
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/reusable-sonar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
sonar:
name: Sonar Analysis
runs-on: ${{ inputs.operating-system }}
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.owner.login == 'sapphiredev'
if: (github.event_name != 'pull_request' || github.event.pull_request.head.repo.owner.login == 'sapphiredev') && github.actor != 'dependabot[bot]'
steps:
- name: Checkout Project
uses: actions/checkout@v4
Expand All @@ -39,7 +39,6 @@ jobs:
with:
node-version: ${{ inputs.node-version }}
- name: SonarCloud Scan
if: env.SONAR_TOKEN
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/reusable-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
env:
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
- name: SonarCloud Scan
if: inputs.enable-sonar && env.SONAR_TOKEN && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.owner.login == 'sapphiredev')
if: inputs.enable-sonar && github.actor != 'dependabot[bot]' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.owner.login == 'sapphiredev')
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down

0 comments on commit 0bb9d34

Please sign in to comment.