Make run name in CI notification configurable and improve default
See gh-39761
This commit is contained in:
parent
ca6ee61493
commit
049a2c01ed
|
|
@ -6,21 +6,25 @@ inputs:
|
||||||
required: true
|
required: true
|
||||||
build-scan-url:
|
build-scan-url:
|
||||||
description: 'URL of the build scan to include in the notification'
|
description: 'URL of the build scan to include in the notification'
|
||||||
|
run-name:
|
||||||
|
description: 'Name of the run to include in the notification'
|
||||||
|
default: ${{ format('{0} {1}', github.ref_name, github.job) }}
|
||||||
runs:
|
runs:
|
||||||
using: composite
|
using: composite
|
||||||
steps:
|
steps:
|
||||||
- shell: bash
|
- shell: bash
|
||||||
run: |
|
run: |
|
||||||
echo "BUILD_SCAN=${{ inputs.build-scan-url == '' && ' [build scan unavailable]' || format(' [<{0}|Build Scan>]', inputs.build-scan-url) }}" >> "$GITHUB_ENV"
|
echo "BUILD_SCAN=${{ inputs.build-scan-url == '' && ' [build scan unavailable]' || format(' [<{0}|Build Scan>]', inputs.build-scan-url) }}" >> "$GITHUB_ENV"
|
||||||
|
echo "RUN_URL=${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" >> "$GITHUB_ENV"
|
||||||
- shell: bash
|
- shell: bash
|
||||||
if: ${{ success() }}
|
if: ${{ success() }}
|
||||||
run: |
|
run: |
|
||||||
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
|
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
|
||||||
- shell: bash
|
- shell: bash
|
||||||
if: ${{ failure() }}
|
if: ${{ failure() }}
|
||||||
run: |
|
run: |
|
||||||
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
|
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
|
||||||
- shell: bash
|
- shell: bash
|
||||||
if: ${{ cancelled() }}
|
if: ${{ cancelled() }}
|
||||||
run: |
|
run: |
|
||||||
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
|
curl -X POST ${{ inputs.webhook-url }} -H 'Content-Type: application/json' -d '{ text: "<${{ env.RUN_URL }}|${{ inputs.run-name }}> was cancalled"}' || true
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
name: 'Java 17 | Windows'
|
name: 'Windows | Java 17'
|
||||||
runs-on: 'windows-latest'
|
runs-on: 'windows-latest'
|
||||||
if: ${{ github.repository == 'spring-projects/spring-boot' }}
|
if: ${{ github.repository == 'spring-projects/spring-boot' }}
|
||||||
steps:
|
steps:
|
||||||
|
|
@ -53,3 +53,4 @@ jobs:
|
||||||
with:
|
with:
|
||||||
webhook-url: ${{ secrets.GOOGLE_CHAT_WEBHOOK_URL }}
|
webhook-url: ${{ secrets.GOOGLE_CHAT_WEBHOOK_URL }}
|
||||||
build-scan-url: ${{ steps.build.outputs.build-scan-url }}
|
build-scan-url: ${{ steps.build.outputs.build-scan-url }}
|
||||||
|
run-name: ${{ format('{0} | Windows | Java 17', github.ref_name) }}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue