From 52f01a5c491268f5eb58f012b36dc8d5df93b690 Mon Sep 17 00:00:00 2001 From: lobo Date: Sun, 26 Feb 2023 19:48:04 +0000 Subject: [PATCH] notifcation through ntfy --- .gitea/workflows/hello_world.yaml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.gitea/workflows/hello_world.yaml b/.gitea/workflows/hello_world.yaml index e007988..e07bdac 100644 --- a/.gitea/workflows/hello_world.yaml +++ b/.gitea/workflows/hello_world.yaml @@ -16,3 +16,19 @@ jobs: run: | ls ${{ github.workspace }} - run: echo "🍏 This job's status is ${{ job.status }}." + - name: Success Notification + if: success() + run: | + curl -u '${{ secrets.NTFY_USER }}:${{ secrets.NTFY_PASSWORD }}' \ + -H 'Title: Job Succeeded. ${{ github.repository }}/${{ github.ref }}' \ + -d 'Job succeeded. See ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_number }} for details' + '${{ secrets.NTFY_HOST }}${{ secrets.NTFY_TOPIC }}'' + - name: Failure Notification + if: failure() + run: | + curl -u '${{ secrets.NTFY_USER }}:${{ secrets.NTFY_PASSWORD }}' \ + -H "Priority: high" + -H 'Title: Job FAILED. ${{ github.repository }}/${{ github.ref }}' \ + -d 'Job failed. See ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_number }} for details' + '${{ secrets.NTFY_HOST }}${{ secrets.NTFY_TOPIC }}'' +