Skip to content

Commit 5f457bc

Browse files
laurentftechclaude
andcommitted
ci: Add ntfy notification step to release workflow
Sends a notification via ntfy.sh when the release workflow completes (success or failure). Requires NTFY_RELEASE_TOPIC secret. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 310576a commit 5f457bc

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

.github/workflows/release.yml

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,4 +120,28 @@ jobs:
120120
121121
git add Formula/ntfy-macos.rb
122122
git commit -m "Update ntfy-macos to ${VERSION}"
123-
git push https://x-access-token:${TAP_GITHUB_TOKEN}@github.com/laurentftech/homebrew-ntfy-macos.git main
123+
git push https://x-access-token:${TAP_GITHUB_TOKEN}@github.com/laurentftech/homebrew-ntfy-macos.git main
124+
125+
- name: Notify via ntfy
126+
if: always()
127+
env:
128+
NTFY_TOPIC: ${{ secrets.NTFY_RELEASE_TOPIC }}
129+
VERSION: ${{ steps.version.outputs.VERSION }}
130+
run: |
131+
if [ -z "$NTFY_TOPIC" ]; then
132+
echo "NTFY_RELEASE_TOPIC not set, skipping notification"
133+
exit 0
134+
fi
135+
if [ "${{ job.status }}" = "success" ]; then
136+
curl -s -X POST "https://ntfy.sh/$NTFY_TOPIC" \
137+
-H "Title: ntfy-macos ${VERSION} released" \
138+
-H "Priority: 3" \
139+
-H "Tags: tada,rocket" \
140+
-d "Release ${VERSION} published successfully. Homebrew tap updated."
141+
else
142+
curl -s -X POST "https://ntfy.sh/$NTFY_TOPIC" \
143+
-H "Title: ntfy-macos ${VERSION} release failed" \
144+
-H "Priority: 4" \
145+
-H "Tags: x,warning" \
146+
-d "Release workflow failed for ${VERSION}. Check: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
147+
fi

0 commit comments

Comments
 (0)