diff --git a/action.yml b/action.yml index 99bb490..6631f5b 100644 --- a/action.yml +++ b/action.yml @@ -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" \