add action.yml/sort environment

This commit is contained in:
Emil Lerch 2023-03-27 14:25:16 -07:00
parent 8220961b60
commit e8eab2c120
Signed by: lobo
GPG Key ID: A7B62D657EF764F8
2 changed files with 43 additions and 2 deletions

23
action.yml Normal file
View File

@ -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'

View File

@ -1,5 +1,23 @@
#!/bin/sh #!/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 }}'
#