diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c9dcae6..fbd507f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,3 +30,18 @@ jobs: name: snapshot-dist path: dist/snapshot-* if-no-files-found: error + + # Always run, regardless of job status. The script is a side-effect; + # if the notification itself fails we swallow the error so CI does + # not turn red on a Bark outage. + - name: Notify Bark + if: always() + run: | + if [ "${{ job.status }}" = "success" ]; then + TITLE="✅ CI: ${{ github.repository }}@${{ github.ref_name }}" + BODY="Build OK for ${{ github.sha }} by ${{ github.actor }}" + else + TITLE="❌ CI: ${{ github.repository }}@${{ github.ref_name }}" + BODY="Build FAILED for ${{ github.sha }} by ${{ github.actor }}" + fi + ./scripts/bark-notify.sh "$TITLE" "$BODY" || echo "Bark notify failed (non-fatal)" diff --git a/scripts/bark-notify.sh b/scripts/bark-notify.sh new file mode 100755 index 0000000..e1013ee --- /dev/null +++ b/scripts/bark-notify.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +# bark-notify.sh — push a notification to the local Bark server. +# +# Usage: bark-notify.sh