-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prepare for deploy from GitHub Actions
See gh-1508
- Loading branch information
1 parent
ab53c29
commit 2717f4e
Showing
2 changed files
with
53 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
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 | ||
status: | ||
description: 'Status of the job' | ||
required: true | ||
run-name: | ||
description: 'Name of the run to include in the notification' | ||
default: ${{ format('{0} {1}', github.ref_name, github.job) }} | ||
runs: | ||
using: composite | ||
steps: | ||
- shell: bash | ||
run: | | ||
echo "RUN_URL=${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" >> "$GITHUB_ENV" | ||
- shell: bash | ||
if: ${{ inputs.status == 'success' }} | ||
run: | | ||
curl -X POST '${{ inputs.webhook-url }}' -H 'Content-Type: application/json' -d '{ text: "<${{ env.RUN_URL }}|${{ inputs.run-name }}> was successful"}' || true | ||
- shell: bash | ||
if: ${{ inputs.status == 'failure' }} | ||
run: | | ||
curl -X POST '${{ inputs.webhook-url }}' -H 'Content-Type: application/json' -d '{ text: "<users/all> *<${{ env.RUN_URL }}|${{ inputs.run-name }}> failed* "}' || true | ||
- shell: bash | ||
if: ${{ inputs.status == 'cancelled' }} | ||
run: | | ||
curl -X POST '${{ inputs.webhook-url }}' -H 'Content-Type: application/json' -d '{ text: "<${{ env.RUN_URL }}|${{ inputs.run-name }}> was cancelled"}' || true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters