initial: notify-email composite action
Fritzlab-themed CI mail action: HTML (inline styles, dark palette) + plain-text alternative, relayed via mail.fritzlab.net:25 trusted-CIDR rule. Auto-injects repo/branch/SHA/workflow/run from github context. Status drives accent + subject prefix (failure/success/info).
This commit is contained in:
+64
@@ -0,0 +1,64 @@
|
||||
name: Notify by Email
|
||||
description: |
|
||||
Send a fritzlab-themed email from a CI workflow via mail.fritzlab.net.
|
||||
Gating is the caller's responsibility (typically `if: failure()`); the
|
||||
action always sends when invoked. Auto-injects repo, branch, SHA, workflow,
|
||||
and run URL — caller supplies subject, summary, and optional details.
|
||||
inputs:
|
||||
to:
|
||||
description: Recipient address.
|
||||
required: false
|
||||
default: noc@fritzlab.net
|
||||
from:
|
||||
description: Sender address. Must be permitted by mail.fritzlab.net relay rules.
|
||||
required: false
|
||||
default: ci@fritzlab.net
|
||||
status:
|
||||
description: failure | success | info — drives accent color and subject prefix.
|
||||
required: false
|
||||
default: info
|
||||
subject:
|
||||
description: Mail subject (status prefix is added automatically). Defaults to summary when empty.
|
||||
required: false
|
||||
default: ''
|
||||
summary:
|
||||
description: One-line headline rendered at the top of the email body.
|
||||
required: true
|
||||
details:
|
||||
description: Optional multiline preformatted block (rendered in a monospace card). Leave empty to omit.
|
||||
required: false
|
||||
default: ''
|
||||
smtp-host:
|
||||
description: SMTP relay host.
|
||||
required: false
|
||||
default: mail.fritzlab.net
|
||||
smtp-port:
|
||||
description: SMTP port (relay is on 25, trusted-CIDR, no auth).
|
||||
required: false
|
||||
default: '25'
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Send notification
|
||||
shell: bash
|
||||
env:
|
||||
NOTIFY_TO: ${{ inputs.to }}
|
||||
NOTIFY_FROM: ${{ inputs.from }}
|
||||
NOTIFY_STATUS: ${{ inputs.status }}
|
||||
NOTIFY_SUBJECT: ${{ inputs.subject }}
|
||||
NOTIFY_SUMMARY: ${{ inputs.summary }}
|
||||
NOTIFY_DETAILS: ${{ inputs.details }}
|
||||
NOTIFY_SMTP_HOST: ${{ inputs.smtp-host }}
|
||||
NOTIFY_SMTP_PORT: ${{ inputs.smtp-port }}
|
||||
GH_SERVER_URL: ${{ github.server_url }}
|
||||
GH_REPOSITORY: ${{ github.repository }}
|
||||
GH_REF_NAME: ${{ github.ref_name }}
|
||||
GH_SHA: ${{ github.sha }}
|
||||
GH_WORKFLOW: ${{ github.workflow }}
|
||||
GH_JOB: ${{ github.job }}
|
||||
GH_RUN_ID: ${{ github.run_id }}
|
||||
GH_RUN_NUMBER: ${{ github.run_number }}
|
||||
GH_RUN_ATTEMPT: ${{ github.run_attempt }}
|
||||
GH_ACTOR: ${{ github.actor }}
|
||||
GH_EVENT_NAME: ${{ github.event_name }}
|
||||
run: python3 ${{ github.action_path }}/scripts/send.py
|
||||
Reference in New Issue
Block a user