diff --git a/.github/workflows/sonar_pr.yml b/.github/workflows/sonar_pr.yml index 98230cd4..dcf50738 100644 --- a/.github/workflows/sonar_pr.yml +++ b/.github/workflows/sonar_pr.yml @@ -1,9 +1,10 @@ name: SonarCloud -on: - pull_request_target: - branches: - - main - types: [ opened, synchronize, reopened ] +# on: +# pull_request_target: +# branches: +# - main +# types: [ opened, synchronize, reopened ] +on: [ push, workflow_dispatch ] jobs: build: @@ -25,17 +26,18 @@ jobs: path: ~/.sonar/cache key: ${{ runner.os }}-sonar restore-keys: ${{ runner.os }}-sonar - - name: Cache Maven packages - uses: actions/cache@v3 - with: - path: ~/.m2 - key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} - restore-keys: ${{ runner.os }}-m2 + # - name: Cache Maven packages + # uses: actions/cache@v3 + # with: + # path: ~/.m2 + # key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} + # restore-keys: ${{ runner.os }}-m2 - name: Build and analyze env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} run: > + mvn clean; mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=WSA-Utopia-Discord-Bot -Dsonar.organization=waterball-software-academy