Skip to content

Commit 049a2c0

Browse files
committed
Make run name in CI notification configurable and improve default
See gh-39761
1 parent ca6ee61 commit 049a2c0

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

.github/actions/send-notification/action.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,25 @@ inputs:
66
required: true
77
build-scan-url:
88
description: 'URL of the build scan to include in the notification'
9+
run-name:
10+
description: 'Name of the run to include in the notification'
11+
default: ${{ format('{0} {1}', github.ref_name, github.job) }}
912
runs:
1013
using: composite
1114
steps:
1215
- shell: bash
1316
run: |
1417
echo "BUILD_SCAN=${{ inputs.build-scan-url == '' && ' [build scan unavailable]' || format(' [<{0}|Build Scan>]', inputs.build-scan-url) }}" >> "$GITHUB_ENV"
18+
echo "RUN_URL=${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" >> "$GITHUB_ENV"
1519
- shell: bash
1620
if: ${{ success() }}
1721
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 }}"}' || true
22+
curl -X POST ${{ inputs.webhook-url }} -H 'Content-Type: application/json' -d '{ text: "<${{ env.RUN_URL }}|${{ inputs.run-name }}> was successful ${{ env.BUILD_SCAN }}"}' || true
1923
- shell: bash
2024
if: ${{ failure() }}
2125
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 }}"}' || true
26+
curl -X POST ${{ inputs.webhook-url }} -H 'Content-Type: application/json' -d '{ text: "<users/all> *<${{ env.RUN_URL }}|${{ inputs.run-name }}> failed* ${{ env.BUILD_SCAN }}"}' || true
2327
- shell: bash
2428
if: ${{ cancelled() }}
2529
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>"}' || true
30+
curl -X POST ${{ inputs.webhook-url }} -H 'Content-Type: application/json' -d '{ text: "<${{ env.RUN_URL }}|${{ inputs.run-name }}> was cancalled"}' || true

.github/workflows/windows-build.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ concurrency:
77
group: ${{ github.workflow }}-${{ github.ref }}
88
jobs:
99
build:
10-
name: 'Java 17 | Windows'
10+
name: 'Windows | Java 17'
1111
runs-on: 'windows-latest'
1212
if: ${{ github.repository == 'spring-projects/spring-boot' }}
1313
steps:
@@ -53,3 +53,4 @@ jobs:
5353
with:
5454
webhook-url: ${{ secrets.GOOGLE_CHAT_WEBHOOK_URL }}
5555
build-scan-url: ${{ steps.build.outputs.build-scan-url }}
56+
run-name: ${{ format('{0} | Windows | Java 17', github.ref_name) }}

0 commit comments

Comments
 (0)