Source: .github/workflows/discord.yml · reusable workflow
Send one release or failure notification to a configured Discord webhook.
Intended for: Internal notification lane.
Release behavior#
Public workflows aggregate required job results before invoking this helper. If WEBHOOK_URL secret is absent, it skips instead of failing. The legacy webhook_url input is declared but the executable path reads the secret.
Artifacts and effects#
- Discord embed when a webhook secret is available
Assumptions and permissions#
- Public callers select DISCORD_CHANNEL_WEBHOOK first, then DW_TOOLS_CHANNEL_WEBHOOK.
- Every new failure-bearing job must be added to the public workflow's notification needs list.
Failure modes#
- Webhook deleted or invalid: inspect the final notification job.
- A missing needs entry can hide a failed job from the summary.
Example#
Prefer the public workflows' generate_discord_notification flag and inherited secrets.
Inputs#
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
avatar_url | string | false | https://avatars.githubusercontent.com/u/138459727?s=400&u=827e40e3dd9c110c15b3bff26eec0144841e657d&v=4 | — |
description | string | false | — | |
footer_text | string | false | — | |
title | string | false | — | |
webhook_url | string | false | — |
Secrets#
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
WEBHOOK_URL | — | false | — | — |
Permissions#
Top-level: —. Undeclared means inherited from the caller, not "none needed".
Job dependency graph#
Edges are YAML needs; conditional jobs may not run. Conditions are listed below.
Read diagram source
flowchart TD
n_discord_notify["discord-notify"]
Jobs#
| Job | Needs | Runner / delegate | Container / strategy | Condition |
|---|---|---|---|---|
discord-notify | ubuntu-latest / — | — / — | — |
Steps#
discord-notify#
| Step | Action / command | Condition |
|---|---|---|
| Skip Missing Webhook | echo "Discord webhook secret was not provided; skipping notification." | env.WEBHOOK_URL == '' |
| Detect Release URL | { echo "release_time=$(date -u "+%F %T")" if [[ "$REF" == refs/tags/* ]]; then echo "release_name=$REF_NAME" echo "display_name=$REF_NAME" else echo "release_name=development" echo "display_name=${SHA:0:7}" fi } >> "$GITHUB_OUTPUT" | env.WEBHOOK_URL != '' |
| Initialize Empty Fields | { if [[ -z "$TITLE" ]]; then echo "title=$REPOSITORY_NAME has been updated." else echo "title=$TITLE" fi if [[ -z "$DESCRIPTION" ]]; then echo "description=$DISPLAY_NAME is now available on GitHub and the AUR." else echo "description=$DESCRIPTION" fi if [[ -z "$FOOTER_TEXT" ]]; then echo "footer_text=Workflow: $RUN_ID by: $ACTOR at: $RELEASE_TIME" else echo "footer_text=$FOOTER_TEXT" fi } >> "$GITHUB_OUTPUT" | env.WEBHOOK_URL != '' |
| Discord Webhook Action | tsickert/discord-webhook@v7.0.0 | env.WEBHOOK_URL != '' |