Fix: read NTFY_TOKEN from inherited env first, input as fallback
This commit is contained in:
+4
-4
@@ -10,7 +10,7 @@ inputs:
|
||||
description: 'ntfy topic'
|
||||
required: true
|
||||
ntfy_token:
|
||||
description: 'ntfy auth token (bearer). Store in CI secret.'
|
||||
description: 'ntfy auth token (bearer). Store in CI secret and pass via env:'
|
||||
default: ''
|
||||
required: false
|
||||
status:
|
||||
@@ -28,7 +28,6 @@ runs:
|
||||
env:
|
||||
NTFY_URL: ${{ inputs.ntfy_url }}
|
||||
NTFY_TOPIC: ${{ inputs.ntfy_topic }}
|
||||
NTFY_TOKEN: ${{ inputs.ntfy_token }}
|
||||
MESSAGE: ${{ inputs.message }}
|
||||
run: |
|
||||
if [ "${{ inputs.status }}" = "failure" ]; then
|
||||
@@ -39,8 +38,9 @@ runs:
|
||||
TAGS="rocket,white_check_mark,🎉,docker"
|
||||
fi
|
||||
AUTH=()
|
||||
if [ -n "${NTFY_TOKEN}" ]; then
|
||||
AUTH=(-H "Authorization: Bearer ${NTFY_TOKEN}")
|
||||
TOKEN="${NTFY_TOKEN:-${{ inputs.ntfy_token }}}"
|
||||
if [ -n "$TOKEN" ]; then
|
||||
AUTH=(-H "Authorization: Bearer ${TOKEN}")
|
||||
fi
|
||||
curl -sf \
|
||||
-H "Title: CI Notification" \
|
||||
|
||||
Reference in New Issue
Block a user