new notification updates
This commit is contained in:
@@ -65,11 +65,11 @@ jobs:
|
|||||||
title: "Kubernetes Apply Failed"
|
title: "Kubernetes Apply Failed"
|
||||||
message: |
|
message: |
|
||||||
Failed to apply kubernetes configs
|
Failed to apply kubernetes configs
|
||||||
|
Workflow: ${{ gitea.workflow }}
|
||||||
Repository: ${{ gitea.repository }}
|
Repository: ${{ gitea.repository }}
|
||||||
Run: ${{ gitea.run_number }}
|
|
||||||
Job: update-infrastructure
|
Job: update-infrastructure
|
||||||
Status: ${{ needs.update-infrastructure.result }}
|
Status: ${{ needs.update-infrastructure.result }}
|
||||||
|
Time: ${{ gitea.run_started_at }}
|
||||||
Logs: https://git.alexmickelson.guru/${{ gitea.repository }}/actions/runs/${{ gitea.run_id }}
|
action_url: "https://git.alexmickelson.guru/${{ gitea.repository }}/actions/runs/${{ gitea.run_number }}/jobs/${{ gitea.job }}"
|
||||||
priority: "high"
|
priority: "high"
|
||||||
tags: "rotating_light,kubernetes"
|
tags: "rotating_light,kubernetes"
|
||||||
@@ -16,6 +16,10 @@ on:
|
|||||||
required: false
|
required: false
|
||||||
type: string
|
type: string
|
||||||
default: "warning"
|
default: "warning"
|
||||||
|
action_url:
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
default: ""
|
||||||
secrets:
|
secrets:
|
||||||
NTFY_CHANNEL:
|
NTFY_CHANNEL:
|
||||||
required: true
|
required: true
|
||||||
@@ -28,9 +32,14 @@ jobs:
|
|||||||
working-directory: /home/gitea-runner
|
working-directory: /home/gitea-runner
|
||||||
run: |
|
run: |
|
||||||
set -e
|
set -e
|
||||||
|
ACTION_HEADER=""
|
||||||
|
if [ -n "${{ inputs.action_url }}" ]; then
|
||||||
|
ACTION_HEADER='-H "Actions: view, View Logs, ${{ inputs.action_url }}"'
|
||||||
|
fi
|
||||||
cat <<EOF | curl -f -H "Title: ${{ inputs.title }}" \
|
cat <<EOF | curl -f -H "Title: ${{ inputs.title }}" \
|
||||||
-H "Priority: ${{ inputs.priority }}" \
|
-H "Priority: ${{ inputs.priority }}" \
|
||||||
-H "Tags: ${{ inputs.tags }}" \
|
-H "Tags: ${{ inputs.tags }}" \
|
||||||
|
$ACTION_HEADER \
|
||||||
--data-binary "@-" \
|
--data-binary "@-" \
|
||||||
"https://ntfy.sh/${{ secrets.NTFY_CHANNEL }}"
|
"https://ntfy.sh/${{ secrets.NTFY_CHANNEL }}"
|
||||||
${{ inputs.message }}
|
${{ inputs.message }}
|
||||||
|
|||||||
Reference in New Issue
Block a user