From a5a749de7a644e0756751f9e9c1a0dcf0d802a48 Mon Sep 17 00:00:00 2001 From: lobo Date: Mon, 27 Feb 2023 00:01:51 +0000 Subject: [PATCH] add notification/action.yaml --- .gitea/workflows/notification/action.yaml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .gitea/workflows/notification/action.yaml diff --git a/.gitea/workflows/notification/action.yaml b/.gitea/workflows/notification/action.yaml new file mode 100644 index 0000000..5b6d64a --- /dev/null +++ b/.gitea/workflows/notification/action.yaml @@ -0,0 +1,23 @@ +name: GitHub Actions Demo +run-name: ${{ github.actor }} is testing out GitHub Actions 🚀 +jobs: + Notify: + runs-on: ubuntu-latest + steps: + - name: Success Notification + if: success() + run: | + curl -u '${{ secrets.NTFY_USER }}:${{ secrets.NTFY_PASSWORD }}' \ + -H 'Title: Job Succeeded. ${{ github.repository }}/${{ github.ref }}' \ + -H "Tags: +1" \ + -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 }}' \ + -H "Tags: warning" \ + -d 'Job failed. See '$GITHUB_SERVER_URL'/${{ github.repository }}/actions/runs/${{ github.run_number }} for details' \ + '${{ secrets.NTFY_HOST }}${{ secrets.NTFY_TOPIC }}' \ No newline at end of file