Skip to content

Commit

Permalink
fix: sonarcloud analysis on PR
Browse files Browse the repository at this point in the history
  • Loading branch information
lauthieb committed Dec 29, 2020
1 parent a4b1e0e commit 443b8c8
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
name: sonarchecks
name: SonarCloud Main

on:
pull_request_target:
types: [opened, synchronize, reopened]
push:
branches:
- main
jobs:
sonarcloud:
name: SonarCloud
name: SonarCloud analysis
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/sonarcloud-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: SonarCloud PR

on:
pull_request_target:
types: [opened, synchronize, reopened]
jobs:
sonarcloud:
name: SonarCloud analysis
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
with:
args: >
-Dsonar.pullrequest.key=${{ github.event.number }}
-Dsonar.pullrequest.branch=${{ github.HEAD_REF }}
-Dsonar.pullrequest.base=${{ github.BASE_REF }}
-Dsonar.pullrequest.github.repository=${{ github.repository }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

0 comments on commit 443b8c8

Please sign in to comment.