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..c0b1341d --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,4 @@ +sonar.organization=react-native-datetimepicker +sonar.projectKey=datetimepicker +sonar.sources=src +sonar.sourceEncoding=UTF-8