mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-03-22 23:29:08 +01:00
ci: Use short commit hash in notifications
This commit is contained in:
parent
0b09699cc5
commit
fd5acfbcf6
1 changed files with 8 additions and 8 deletions
16
.github/workflows/ci.yml
vendored
16
.github/workflows/ci.yml
vendored
|
|
@ -145,30 +145,30 @@ jobs:
|
|||
- name: Notify success
|
||||
if: needs.await-deploy.result == 'success'
|
||||
env:
|
||||
BODY: |-
|
||||
Commit `${{ github.sha }}` deployed successfully.
|
||||
> ${{ github.event.head_commit.message }}
|
||||
SHA: ${{ github.sha }}
|
||||
COMMIT_MSG: ${{ github.event.head_commit.message }}
|
||||
run: |
|
||||
body=$(printf 'Commit `%s` deployed successfully.\n> %s' "${SHA::7}" "$COMMIT_MSG")
|
||||
curl -s \
|
||||
-H "Title: CI: Deployment succeeded" \
|
||||
-H "Priority: low" \
|
||||
-H "Tags: white_check_mark" \
|
||||
-H "Actions: view, Open workflow run, ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" \
|
||||
-H "Markdown: yes" \
|
||||
-d "$BODY" \
|
||||
-d "$body" \
|
||||
https://ntfy.sh/splitleaf
|
||||
- name: Notify failure
|
||||
if: needs.await-deploy.result == 'failure'
|
||||
env:
|
||||
BODY: |-
|
||||
Commit `${{ github.sha }}` failed to deploy.
|
||||
> ${{ github.event.head_commit.message }}
|
||||
SHA: ${{ github.sha }}
|
||||
COMMIT_MSG: ${{ github.event.head_commit.message }}
|
||||
run: |
|
||||
body=$(printf 'Commit `%s` failed to deploy.\n> %s' "${SHA::7}" "$COMMIT_MSG")
|
||||
curl -s \
|
||||
-H "Title: CI: Deployment failed" \
|
||||
-H "Priority: default" \
|
||||
-H "Tags: rotating_light" \
|
||||
-H "Actions: view, Open workflow run, ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" \
|
||||
-H "Markdown: yes" \
|
||||
-d "$BODY" \
|
||||
-d "$body" \
|
||||
https://ntfy.sh/splitleaf
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue