Skip to content

Commit 849f41a

Browse files
committed
Merge branch '3.1.x' into 3.2.x
2 parents 460d8a0 + c1b15cd commit 849f41a

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Send notification
2+
description: Sends a Google Chat message as a notification of the job's outcome
3+
inputs:
4+
webhook-url:
5+
description: 'Google Chat Webhook URL'
6+
required: true
7+
build-scan-url:
8+
description: 'URL of the build scan to include in the notification'
9+
runs:
10+
using: composite
11+
steps:
12+
- shell: bash
13+
run: |
14+
echo "BUILD_SCAN=${{ inputs.build-scan-url == '' && ' [build scan unavailable]' || format(' [<{0}|Build Scan>]', inputs.build-scan-url) }}" >> "$GITHUB_ENV"
15+
- shell: bash
16+
if: ${{ success() }}
17+
run: |
18+
curl -X POST ${{ inputs.webhook-url }} -H 'Content-Type: application/json' -d '{ text: "<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|spring-boot-${{ github.ref_name }} ${{ github.job }} was successful> ${{ env.BUILD_SCAN }}"}'
19+
- shell: bash
20+
if: ${{ failure() }}
21+
run: |
22+
curl -X POST ${{ inputs.webhook-url }} -H 'Content-Type: application/json' -d '{ text: "<users/all> *<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|spring-boot-${{ github.ref_name }} ${{ github.job }} failed>* ${{ env.BUILD_SCAN }}"}'
23+
- shell: bash
24+
if: ${{ cancelled() }}
25+
run: |
26+
curl -X POST ${{ inputs.webhook-url }} -H 'Content-Type: application/json' -d '{ text: "<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|spring-boot-${{ github.ref_name }} ${{ github.job }} was cancalled>"}'

.github/workflows/windows-build.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,17 @@ jobs:
3636
- name: Stop Docker service
3737
run: Stop-Service -name Docker
3838
- name: Build
39+
id: build
3940
env:
4041
CI: 'true'
4142
GRADLE_ENTERPRISE_URL: 'https://ge.spring.io'
4243
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_SECRET_ACCESS_KEY }}
4344
GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GRADLE_ENTERPRISE_CACHE_USER }}
4445
GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }}
4546
run: ./gradlew build
47+
- name: Send notification
48+
uses: ./.github/actions/send-notification
49+
if: always()
50+
with:
51+
webhook-url: ${{ secrets.GOOGLE_CHAT_WEBHOOK_URL }}
52+
build-scan-url: ${{ steps.build.outputs.build-scan-url }}

0 commit comments

Comments
 (0)