Browse Source

Merge branch '3.1.x' into 3.2.x

pull/39958/head
Andy Wilkinson 2 years ago
parent
commit
849f41a355
  1. 26
      .github/actions/send-notification/action.yml
  2. 7
      .github/workflows/windows-build.yml

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

@ -0,0 +1,26 @@ @@ -0,0 +1,26 @@
name: Send notification
description: Sends a Google Chat message as a notification of the job's outcome
inputs:
webhook-url:
description: 'Google Chat Webhook URL'
required: true
build-scan-url:
description: 'URL of the build scan to include in the notification'
runs:
using: composite
steps:
- shell: bash
run: |
echo "BUILD_SCAN=${{ inputs.build-scan-url == '' && ' [build scan unavailable]' || format(' [<{0}|Build Scan>]', inputs.build-scan-url) }}" >> "$GITHUB_ENV"
- shell: bash
if: ${{ success() }}
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 }}"}'
- shell: bash
if: ${{ failure() }}
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 }}"}'
- shell: bash
if: ${{ cancelled() }}
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>"}'

7
.github/workflows/windows-build.yml

@ -36,6 +36,7 @@ jobs: @@ -36,6 +36,7 @@ jobs:
- name: Stop Docker service
run: Stop-Service -name Docker
- name: Build
id: build
env:
CI: 'true'
GRADLE_ENTERPRISE_URL: 'https://ge.spring.io'
@ -43,3 +44,9 @@ jobs: @@ -43,3 +44,9 @@ jobs:
GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GRADLE_ENTERPRISE_CACHE_USER }}
GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }}
run: ./gradlew build
- name: Send notification
uses: ./.github/actions/send-notification
if: always()
with:
webhook-url: ${{ secrets.GOOGLE_CHAT_WEBHOOK_URL }}
build-scan-url: ${{ steps.build.outputs.build-scan-url }}

Loading…
Cancel
Save