From 36d49eb7ab8462d92f49cd31e4a342979d3f3992 Mon Sep 17 00:00:00 2001 From: Damian Date: Wed, 1 Jul 2026 15:25:49 +0200 Subject: [PATCH] style(ci): wrap monthly digest in a colored Slack attachment Render the digest inside a Slack attachment with a left color bar instead of bare blocks, matching the PR notifications' look. Uses a neutral light-gray (#CCCCCC) so the monthly summary reads distinct from the event-colored PR notifications (green/blue/purple). Both the populated and the "No PRs" branches get the bar. Co-Authored-By: Claude Opus 4.8 --- .github/workflows/pr-slack-monthly-digest.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pr-slack-monthly-digest.yml b/.github/workflows/pr-slack-monthly-digest.yml index 6cd56fe..721f4c6 100644 --- a/.github/workflows/pr-slack-monthly-digest.yml +++ b/.github/workflows/pr-slack-monthly-digest.yml @@ -147,15 +147,16 @@ jobs: run: | set -euo pipefail REPO="${{ github.repository }}" + ACCENT="#CCCCCC" # neutral light-gray bar for the monthly digest if [[ "$SKIP" == "true" ]]; then - jq -n --arg repo "$REPO" --arg month "$MONTH_LABEL" \ - '{blocks: [{type: "section", text: {type: "mrkdwn", text: ("*Monthly digest · " + ($repo | split("/")[1]) + " · " + $month + "*\n_No PRs opened or closed in this period._")}}]}' > slack.json + jq -n --arg repo "$REPO" --arg month "$MONTH_LABEL" --arg accent "$ACCENT" \ + '{attachments: [{color: $accent, blocks: [{type: "section", text: {type: "mrkdwn", text: ("*Monthly digest · " + ($repo | split("/")[1]) + " · " + $month + "*\n_No PRs opened or closed in this period._")}}]}]}' > slack.json else - jq -n --arg repo "$REPO" --arg month "$MONTH_LABEL" \ + jq -n --arg repo "$REPO" --arg month "$MONTH_LABEL" --arg accent "$ACCENT" \ --slurpfile ctx digest-context.json --slurpfile ai ai.json \ '($ctx[0]) as $c | ($ai[0]) as $ai | ($c.totals) as $t | - {blocks: ([ + {attachments: [{color: $accent, blocks: ([ {type: "header", text: {type: "plain_text", text: ("Monthly digest · " + ($repo | split("/")[1]) + " · " + $month), emoji: true}}, {type: "section", text: {type: "mrkdwn", text: ("*" + ($t.prs|tostring) + " PRs* · *" + ($t.merged|tostring) + " merged* · *+" + ($t.additions|tostring) + " / −" + ($t.deletions|tostring) + "* lines")}}, {type: "divider"}, @@ -165,7 +166,7 @@ jobs: ] + (if ($ai.dependency_notes | length) > 0 then [{type: "section", text: {type: "mrkdwn", text: ("*Dependencies*\n" + $ai.dependency_notes)}}] else [] end) - + [{type: "section", text: {type: "mrkdwn", text: ("*PR index*" + (if ($c.prs | length) > 10 then " · latest 10 of " + ($c.prs | length | tostring) else "" end) + "\n" + ([$c.prs | sort_by(.number) | reverse | .[0:10][] | "• " + .title + " — `" + .author + "` (" + .state + ")"] | join("\n")))}}])}' > slack.json + + [{type: "section", text: {type: "mrkdwn", text: ("*PR index*" + (if ($c.prs | length) > 10 then " · latest 10 of " + ($c.prs | length | tostring) else "" end) + "\n" + ([$c.prs | sort_by(.number) | reverse | .[0:10][] | "• " + .title + " — `" + .author + "` (" + .state + ")"] | join("\n")))}}])}]}' > slack.json fi cat slack.json