Skip to content

Commit

Permalink
Notify slack channel on failure
Browse files Browse the repository at this point in the history
  • Loading branch information
ssylver93 committed Oct 1, 2024
1 parent db106fe commit 413266f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
14 changes: 14 additions & 0 deletions .github/workflows/sonarscan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
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
Expand Down
2 changes: 1 addition & 1 deletion sonar-project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 413266f

Please sign in to comment.