Use inline json and Webhooks plugin
Former plugins breaks when extracting url when its a PR
@@ -20,7 +20,14 @@ jobs:
- uses: muinmomin/webhook-action@v1.0.0
if: failure()
with:
- data: ${{ toJson(job) }}
+ data: |
+ {
+ "attachments": [
+ {
+ "title": "Build Failed",
+ "color": "danger"
+ }]}
+
url: ${{ secrets.SLACK_WEBHOOK }}
test:
runs-on: ubuntu-latest
@@ -45,7 +52,14 @@ jobs:
- uses: muinmomin/webhook-action@v1.0.0
if: failure()
with:
- data: ${{ toJson(job) }}
+ data: |
+ {
+ "attachments": [
+ {
+ "title": "Build Failed",
+ "color": "danger"
+ }]}
+
url: ${{ secrets.SLACK_WEBHOOK }}
gradleBuild:
@@ -67,7 +81,14 @@ jobs:
- uses: muinmomin/webhook-action@v1.0.0
if: failure()
with:
- data: ${{ toJson(job) }}
+ data: |
+ {
+ "attachments": [
+ {
+ "title": "Gradle Build Failed",
+ "color": "danger"
+ }]}
+
url: ${{ secrets.SLACK_WEBHOOK }}
itest:
@@ -88,7 +109,14 @@ jobs:
- uses: muinmomin/webhook-action@v1.0.0
if: failure()
with:
- data: ${{ toJson(job) }}
+ data: |
+ {
+ "attachments": [
+ {
+ "title": "Integration tests Failed",
+ "color": "danger"
+ }]}
+
url: ${{ secrets.SLACK_WEBHOOK }}
vaultTests:
@@ -114,7 +142,14 @@ jobs:
- uses: muinmomin/webhook-action@v1.0.0
if: failure()
with:
- data: ${{ toJson(job) }}
+ data: |
+ {
+ "attachments": [
+ {
+ "title": "Vault tests Failed",
+ "color": "danger"
+ }]}
+
url: ${{ secrets.SLACK_WEBHOOK }}
atest:
runs-on: ubuntu-latest
@@ -172,7 +207,14 @@ jobs:
- uses: muinmomin/webhook-action@v1.0.0
if: failure()
with:
- data: ${{ toJson(job) }}
+ data: |
+ {
+ "attachments": [
+ {
+ "title": "Acceptance tests Failed",
+ "color": "danger"
+ }]}
+
url: ${{ secrets.SLACK_WEBHOOK }}
slackNotification:
@@ -181,5 +223,12 @@ jobs:
steps:
- uses: muinmomin/webhook-action@v1.0.0
with:
- data: ${{ toJson(job) }}
+ data: |
+ {
+ "attachments": [
+ {
+ "title": "Build succeded",
+ "color": "good"
+ }]}
+
url: ${{ secrets.SLACK_WEBHOOK }}
