ci: Use short commit hash in notifications

This commit is contained in:
SebastianStork 2026-03-09 21:31:17 +01:00
parent 0b09699cc5
commit fd5acfbcf6
Signed by: SebastianStork
SSH key fingerprint: SHA256:tRrGdjYOwgHxpSc/wTOZQZEjxcb15P0tyXRsbAfd+2Q

View file

@ -145,30 +145,30 @@ jobs:
- name: Notify success - name: Notify success
if: needs.await-deploy.result == 'success' if: needs.await-deploy.result == 'success'
env: env:
BODY: |- SHA: ${{ github.sha }}
Commit `${{ github.sha }}` deployed successfully. COMMIT_MSG: ${{ github.event.head_commit.message }}
> ${{ github.event.head_commit.message }}
run: | run: |
body=$(printf 'Commit `%s` deployed successfully.\n> %s' "${SHA::7}" "$COMMIT_MSG")
curl -s \ curl -s \
-H "Title: CI: Deployment succeeded" \ -H "Title: CI: Deployment succeeded" \
-H "Priority: low" \ -H "Priority: low" \
-H "Tags: white_check_mark" \ -H "Tags: white_check_mark" \
-H "Actions: view, Open workflow run, ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" \ -H "Actions: view, Open workflow run, ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" \
-H "Markdown: yes" \ -H "Markdown: yes" \
-d "$BODY" \ -d "$body" \
https://ntfy.sh/splitleaf https://ntfy.sh/splitleaf
- name: Notify failure - name: Notify failure
if: needs.await-deploy.result == 'failure' if: needs.await-deploy.result == 'failure'
env: env:
BODY: |- SHA: ${{ github.sha }}
Commit `${{ github.sha }}` failed to deploy. COMMIT_MSG: ${{ github.event.head_commit.message }}
> ${{ github.event.head_commit.message }}
run: | run: |
body=$(printf 'Commit `%s` failed to deploy.\n> %s' "${SHA::7}" "$COMMIT_MSG")
curl -s \ curl -s \
-H "Title: CI: Deployment failed" \ -H "Title: CI: Deployment failed" \
-H "Priority: default" \ -H "Priority: default" \
-H "Tags: rotating_light" \ -H "Tags: rotating_light" \
-H "Actions: view, Open workflow run, ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" \ -H "Actions: view, Open workflow run, ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" \
-H "Markdown: yes" \ -H "Markdown: yes" \
-d "$BODY" \ -d "$body" \
https://ntfy.sh/splitleaf https://ntfy.sh/splitleaf