From e8eab2c1207c904a1fc18b1a825c82e3c8c1d71d Mon Sep 17 00:00:00 2001 From: Emil Lerch Date: Mon, 27 Mar 2023 14:25:16 -0700 Subject: [PATCH] add action.yml/sort environment --- action.yml | 23 +++++++++++++++++++++++ entrypoint.sh | 22 ++++++++++++++++++++-- 2 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 action.yml diff --git a/action.yml b/action.yml new file mode 100644 index 0000000..1c503d2 --- /dev/null +++ b/action.yml @@ -0,0 +1,23 @@ +name: 'Ntfy notification' +description: 'Notifies job status via ntfy' +author: 'lobo' +inputs: + host: + description: 'Ntfy host' + required: true + topic: + description: 'Ntfy topic' + required: true + status: + description: 'Job status. Use ${{ job.status }} for most cases' + required: true + default: '${{ job.status }}' + user: + description: 'Username for ntfy server' + required: true # should be false, but we'll do authenticated sessions only for now + password: + description: 'Password for ntfy server' + required: true # should be false, but we'll do authenticated sessions only for now +runs: + using: 'docker' + image: 'Dockerfile' diff --git a/entrypoint.sh b/entrypoint.sh index def366a..5c58e02 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,5 +1,23 @@ #!/bin/sh -env - +env | sort +#GITHUB_RUN_NUMBER +# Job status: success/failure/cancelled + # 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 }}' + #