From 286d3b52e0e937d20964a3867e9f215f5360cdda Mon Sep 17 00:00:00 2001 From: luancurti Date: Fri, 2 Dec 2022 09:32:22 -0300 Subject: [PATCH] chore(sonar): add github action to scan code --- .github/workflows/sonar-scan.yml | 22 ++++++++++++++++++++++ sonar-project.properties | 4 ++++ 2 files changed, 26 insertions(+) create mode 100644 .github/workflows/sonar-scan.yml create mode 100644 sonar-project.properties diff --git a/.github/workflows/sonar-scan.yml b/.github/workflows/sonar-scan.yml new file mode 100644 index 00000000..a6880744 --- /dev/null +++ b/.github/workflows/sonar-scan.yml @@ -0,0 +1,22 @@ +name: Sonar Scan + +on: + push: + branches: + - master + pull_request: + types: [opened, synchronize, reopened] + +jobs: + sonarcloud: + name: SonarCloud + 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 + env: + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} # Needed to get PR information, if any + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 00000000..b38e4d53 --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,4 @@ +sonar.organization=react-native-datetimepicker +sonar.projectKey=react-native-datetimepicker_datetimepicker +sonar.sources=src +sonar.sourceEncoding=UTF-8