Skip to content

Commit 8864d1e

Browse files
authored
Merge pull request #90 from AnswerConsulting/BENCH-196
BENCH-196 Slack Notification Workflow added
2 parents 0107e22 + 23878bf commit 8864d1e

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

.github/workflows/build_integration_and_code_analysis.yml

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ on:
1313
jobs:
1414
Sonar-Cloud:
1515
name: Static Code Analysis - Sonar Cloud
16+
outputs:
17+
job-status: ${{ job.status }}
1618
runs-on: ubuntu-latest
1719
steps:
1820
- uses: actions/checkout@v3
@@ -44,6 +46,8 @@ jobs:
4446

4547
Build-Test:
4648
name: Integration Test
49+
outputs:
50+
job-status: ${{ job.status }}
4751
runs-on: ubuntu-latest
4852
permissions:
4953
checks: write
@@ -77,4 +81,25 @@ jobs:
7781
coverage_results_path: 'target/site/jacoco/jacoco.xml'
7882
coverage_report_title: 'Test coverage results'
7983
coverage_report_name: 'Test coverage results'
80-
github_token: ${{ secrets.GITHUB_TOKEN }}
84+
github_token: ${{ secrets.GITHUB_TOKEN }}
85+
86+
Notify-Slack:
87+
if: ${{ always() }}
88+
needs: [ Build-Test, Sonar-Cloud ]
89+
runs-on: ubuntu-latest
90+
name: New push to repo
91+
steps:
92+
- name: Send GitHub trigger payload to Slack Workflow Builder
93+
id: slack
94+
uses: slackapi/[email protected]
95+
with:
96+
payload: |
97+
{
98+
"PR_URL": "${{ github.event.pull_request.html_url }}",
99+
"Sonar_Status": "${{ needs.Sonar-Cloud.outputs.job-status }}",
100+
"Test_Status": "${{ needs.Build-Test.outputs.job-status }}",
101+
"Title": "${{ github.event.pull_request.title }}",
102+
"Type": "${{ github.event.action }}"
103+
}
104+
env:
105+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

0 commit comments

Comments
 (0)