Skip to content

feat(notify): support alert cards via header/color/status overrides - #17

Closed
arnavchachra wants to merge 1 commit into
mainfrom
feat/notify-alert-card
Closed

feat(notify): support alert cards via header/color/status overrides#17
arnavchachra wants to merge 1 commit into
mainfrom
feat/notify-alert-card

Conversation

@arnavchachra

Copy link
Copy Markdown
Contributor

What

Extend the notify action so the same rich card can render a general alert, not just a deploy result.

Three optional, backward-compatible inputs:

Input Effect
header Full header line, verbatim, overriding the default <emoji> <label> — <status>. May carry Slack emoji shortcodes.
color Hex color bar overriding the result-derived green/red.
status When set, the first field renders as Status with this text, in place of the Version field.

PR/commit resolution, the body section, and the context line are unchanged, so an alert card still shows the PR (or commit) that target-sha traces to.

Why

Callers that want the same card shape for a non-deploy alert (e.g. an automated merge-revert / guard notice) currently have to hand-roll the entire jq payload + curl. These inputs let them reuse notify instead.

Compatibility

With none of the three inputs set, the emitted payload is byte-identical to before — existing deploy callers are unaffected. Verified the alert-mode payload is valid Slack JSON locally; actionlint + shellcheck clean.

Testing

A consumer repo will pin uses: nurdsoft/ci-workflows/actions/notify@feat/notify-alert-card (per CONTRIBUTING) to validate end-to-end before this merges and the v3 tag moves forward.

The notify card was locked to a deploy result: a green/red header derived
from `result`, a Version field, and a pass/fail color bar. Callers that need
the same card shape for a non-deploy alert (e.g. a merge-revert / guard notice)
had to hand-roll the whole jq payload and curl themselves.

Add three optional, backward-compatible inputs:

- `header` — full header line, verbatim, overriding the default
  "<emoji> <label> — <status>". May carry Slack emoji shortcodes.
- `color`  — hex color bar overriding the result-derived green/red.
- `status` — when set, the first field renders as "Status" with this text
  in place of the "Version" field.

PR/commit resolution, the body section, and the context line are untouched,
so an alert card still shows the PR (or commit) that `target-sha` traces to.
With none of the three set the payload is byte-identical to before, so existing
deploy callers are unaffected. Documented in the README notify table.
@arnavchachra

Copy link
Copy Markdown
Contributor Author

Superseded by #19, which folds these notify alert inputs together with the reusable empty-pr-guard workflow that consumes them (one feature, one release). Branch feat/notify-alert-card left intact as the base of feat/empty-pr-guard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant