diff --git a/.github/workflows/sonarscan.yml b/.github/workflows/sonarscan.yml index 67282316d..c2d23655d 100644 --- a/.github/workflows/sonarscan.yml +++ b/.github/workflows/sonarscan.yml @@ -15,6 +15,20 @@ on: types: [opened, synchronize, reopened] jobs: + on-failure: + runs-on: ubuntu-latest + if: github.event.workflow_run.conclusion == 'failure' || github.event.workflow_run.conclusion == 'timed_out' + steps: + - uses: ravsamhq/notify-slack-action@2.5.0 + with: + status: ${{ github.event.workflow_run.conclusion }} + notification_title: " ${{github.event.workflow_run.name}} - ${{github.event.workflow_run.conclusion}} on ${{github.event.workflow_run.head_branch}} - <${{github.server_url}}/${{github.repository}}/actions/runs/${{github.event.workflow_run.id}}|View Failure>" + message_format: ":fire: *${{github.event.workflow_run.name}}* ${{github.event.workflow_run.conclusion}} in <${{github.server_url}}/${{github.repository}}/${{github.event.workflow_run.head_branch}}|${{github.repository}}>" + footer: "Linked Repo <${{github.server_url}}/${{github.repository}}|${{github.repository}}> | <${{github.server_url}}/${{github.repository}}/actions/runs/${{github.event.workflow_run.id}}|View Failure>" + mention_groups: "C06LDNP3Q7M,!channel" + mention_groups_when: "failure" + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} sonarcloud: name: SonarCloud Scan runs-on: ubuntu-latest @@ -40,7 +54,7 @@ jobs: - name: Set up Node.js uses: actions/setup-node@v4 with: - node-version: '18' + node-version: '18' cache: 'yarn' cache-dependency-path: './client/wfprev-war/src/main/angular/yarn.lock' diff --git a/sonar-project.properties b/sonar-project.properties index 5ed0c0528..4393e931c 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -3,7 +3,7 @@ sonar.projectKey=bcgov_nr-bcws-wfprev sonar.projectName=wfprev-parent sonar.host.url=https://sonarcloud.io sonar.sources=client,server/wfprev-api/target/classes -sonar.exclusions=server/wfprev-api/src/main/java/ca/bc/gov/nrs/wfprev/data/**,**/*ServletInitializer.java,**/*Exception.java,**/*.html,**/*.scss,**/*.main.ts,**/*.environment*.ts,**/*.app-routing.module.ts +sonar.exclusions=server/wfprev-api/src/main/java/ca/bc/gov/nrs/wfprev/data/**,**/*ServletInitializer.java,**/*Exception.java,**/*.html,**/*.scss,**/main.ts,**/environment*.ts,**/app-routing.module.ts sonar.coverage.jacoco.xmlReportPaths=server/wfprev-api/target/site/jacoco/jacoco.xml sonar.javascript.lcov.reportPaths=client/wfprev-war/src/main/angular/coverage/wfprev/lcov.info sonar.sources=server/wfprev-api/src/main/java,client/wfprev-war/src/main/angular/src