add actual notification
This commit is contained in:
parent
37fe4fc874
commit
480f4a768d
|
@ -1,24 +1,32 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
env | sort
|
echo "Notifying job status: $1"
|
||||||
echo "status should be: $1"
|
|
||||||
#GITHUB_RUN_NUMBER
|
#GITHUB_RUN_NUMBER
|
||||||
# Job status: success/failure/cancelled
|
# Job status: success/failure/cancelled
|
||||||
|
|
||||||
# if: success()
|
if [ "$1" = "success" ]; then
|
||||||
# run: |
|
curl -u "${INPUT_USER}:${INPUT__PASSWORD}" \
|
||||||
# curl -u '${{ secrets.NTFY_USER }}:${{ secrets.NTFY_PASSWORD }}' \
|
-H "Title: Job Succeeded. ${GITHUB_REPOSITORY}/${GITHUB_REF}" \
|
||||||
# -H 'Title: Job Succeeded. ${{ github.repository }}/${{ github.ref }}' \
|
-H "Tags: +1" \
|
||||||
# -H "Tags: +1" \
|
-d "Job succeeded. See $GITHUB_SERVER_URL/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_NUMBER} for details" \
|
||||||
# -d 'Job succeeded. See '$GITHUB_SERVER_URL'/${{ github.repository }}/actions/runs/${{ github.run_number }} for details' \
|
"${INPUT_HOST}${INPUT_TOPIC}"
|
||||||
# '${{ secrets.NTFY_HOST }}${{ secrets.NTFY_TOPIC }}'
|
elif [ "$1" = "failure" ]; then
|
||||||
# - name: Failure Notification
|
curl -u "${INPUT_USER}:${INPUT__PASSWORD}" \
|
||||||
# if: failure()
|
-H "Title: Job FAILED. ${GITHUB_REPOSITORY}/${GITHUB_REF}" \
|
||||||
# run: |
|
-H "Priority: high" \
|
||||||
# curl -u '${{ secrets.NTFY_USER }}:${{ secrets.NTFY_PASSWORD }}' \
|
-H "Tags: warning" \
|
||||||
# -H "Priority: high" \
|
-d "Job failed. See $GITHUB_SERVER_URL/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_NUMBER} for details" \
|
||||||
# -H 'Title: Job FAILED. ${{ github.repository }}/${{ github.ref }}' \
|
"${INPUT_HOST}${INPUT_TOPIC}"
|
||||||
# -H "Tags: warning" \
|
elif [ "$1" = "cancelled" ]; then
|
||||||
# -d 'Job failed. See '$GITHUB_SERVER_URL'/${{ github.repository }}/actions/runs/${{ github.run_number }} for details' \
|
# square or x with circle
|
||||||
# '${{ secrets.NTFY_HOST }}${{ secrets.NTFY_TOPIC }}'
|
curl -u "${INPUT_USER}:${INPUT__PASSWORD}" \
|
||||||
#
|
-H "Title: Job cancelled. ${GITHUB_REPOSITORY}/${GITHUB_REF}" \
|
||||||
|
-H "Priority: low" \
|
||||||
|
-H "Tags: x" \
|
||||||
|
-d "Job cancelled. See $GITHUB_SERVER_URL/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_NUMBER} for details" \
|
||||||
|
"${INPUT_HOST}${INPUT_TOPIC}"
|
||||||
|
else
|
||||||
|
echo "Unknown job status $1"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
Loading…
Reference in New Issue
Block a user