Files
infrastructure/.gitea/workflows/notify-ntfy.yml
Alex Mickelson 95beb54b32
Some checks failed
Apply Kuberentes Configs / update-repo (push) Failing after 1s
Apply Kuberentes Configs / update-infrastructure (push) Successful in 3s
Apply Kuberentes Configs / notify-on-failure (push) Has been skipped
Manage Jellyfin Playlists / update-repo (push) Successful in 1s
Manage Jellyfin Playlists / run-python (push) Successful in 47s
Manage Jellyfin Playlists / notify-on-failure (push) Has been skipped
ntfy
2026-03-05 09:39:59 -07:00

52 lines
1.4 KiB
YAML

name: Notify NTFY
on:
workflow_dispatch:
inputs:
title:
required: true
type: string
message:
required: true
type: string
priority:
required: false
type: string
default: "default"
tags:
required: false
type: string
default: "warning"
action_url:
required: false
type: string
default: ""
jobs:
send-notification:
runs-on: [home-server]
env:
NTFY_CHANNEL: ${{ secrets.NTFY_CHANNEL }}
steps:
- name: Send ntfy notification
working-directory: /home/gitea-runner
run: |
set -e
if [ -n "${{ inputs.action_url }}" ]; then
cat <<EOF | curl -f -H "Title: ${{ inputs.title }}" \
-H "Priority: ${{ inputs.priority }}" \
-H "Tags: ${{ inputs.tags }}" \
-H "Actions: view, View Logs, ${{ inputs.action_url }}" \
--data-binary "@-" \
"https://ntfy.sh/$NTFY_CHANNEL"
${{ inputs.message }}
EOF
else
cat <<EOF | curl -f -H "Title: ${{ inputs.title }}" \
-H "Priority: ${{ inputs.priority }}" \
-H "Tags: ${{ inputs.tags }}" \
--data-binary "@-" \
"https://ntfy.sh/$NTFY_CHANNEL"
${{ inputs.message }}
EOF
fi