Skip to content

Commit a05efb2

Browse files
Show override values as fields in Slack alert (#62)
## Summary Replace the CLI command in the HIGH risk Slack alert with clear fields (plan key, repository, run ID) that can be copied into the workflow dispatch form. ## Test plan - [ ] Next HIGH risk alert shows the three values as separate copyable fields
1 parent 5c69c39 commit a05efb2

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

scripts/notify-high-risk.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,8 @@ if [ -n "$FINDINGS_TEXT" ]; then
6464
FINDINGS_BLOCK=",{\"type\":\"section\",\"text\":{\"type\":\"mrkdwn\",\"text\":\"*Findings*\n${ESCAPED_FINDINGS}\"}}"
6565
fi
6666

67-
# Build override command — user can copy-paste this to approve
68-
OVERRIDE_CMD="gh workflow run approve-override.yml --repo ${REPO} -f plan_key=${PLAN_KEY} -f repo=${REPO} -f run_id=${RUN_ID} -f reason=\\\"Override approved\\\""
69-
7067
ESCAPED_SUMMARY=$(echo "$SUMMARY" | python3 -c "import sys,json; print(json.dumps(sys.stdin.read().strip())[1:-1])")
7168
ESCAPED_SOURCE=$(echo "$SOURCE_LINE" | python3 -c "import sys,json; print(json.dumps(sys.stdin.read().strip())[1:-1])")
72-
ESCAPED_CMD=$(echo "$OVERRIDE_CMD" | python3 -c "import sys,json; print(json.dumps(sys.stdin.read().strip())[1:-1])")
7369

7470
PAYLOAD=$(cat <<EOF
7571
{
@@ -78,7 +74,11 @@ PAYLOAD=$(cat <<EOF
7874
{"type":"section","text":{"type":"mrkdwn","text":"${ESCAPED_SOURCE}"}},
7975
{"type":"section","text":{"type":"mrkdwn","text":"*Summary*\n${ESCAPED_SUMMARY}"}}
8076
${FINDINGS_BLOCK},
81-
{"type":"section","text":{"type":"mrkdwn","text":"*Override*\n\`\`\`${ESCAPED_CMD}\`\`\`"}},
77+
{"type":"section","fields":[
78+
{"type":"mrkdwn","text":"*Plan key*\n\`${PLAN_KEY}\`"},
79+
{"type":"mrkdwn","text":"*Repository*\n\`${REPO}\`"},
80+
{"type":"mrkdwn","text":"*Run ID*\n\`${RUN_ID}\`"}
81+
]},
8282
{"type":"actions","elements":[{"type":"button","text":{"type":"plain_text","text":":unlock: Approve Override","emoji":true},"url":"${OVERRIDE_URL}","style":"danger"}]},
8383
{"type":"divider"},
8484
{"type":"context","elements":[{"type":"mrkdwn","text":"Risk: :red_circle: HIGH | Auto-apply blocked — override required"}]}

0 commit comments

Comments
 (0)