Skip to content

Commit

Permalink
Convert DISMISS_COMMENT to single line
Browse files Browse the repository at this point in the history
  • Loading branch information
mirooon committed Mar 5, 2025
1 parent c6f83d4 commit 91ed32e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .github/workflows/securityAlertsReview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,15 @@ jobs:
DISMISS_COMMENT=$(echo "$row" | jq -r '.dismissed_comment')
CAPITALIZED_REASON=$(echo "$DISMISS_REASON" | sed 's/^\(.\)/\U\1/')
# we convert the dismissal comment to a single line because:
# 1. newlines in this context dont render properly (or get escaped) in the final github PR comment
# 2) it keeps the format consistent with how github code scanning alerts display these comments.
DISMISS_COMMENT_SINGLE_LINE=$(echo "$DISMISS_COMMENT" | tr '\n' ' ' | tr '\r' ' ')
COMMENT_BODY+="🟢 [View Alert]($ALERT_URL) - **File:** \`$ALERT_FILE\`\n"
COMMENT_BODY+=" 🔹 $ALERT_DESCRIPTION\n"
COMMENT_BODY+=" 🔹 Dismiss Reason: **$CAPITALIZED_REASON**\n"
COMMENT_BODY+=" 🔹 Dismiss Comment: $DISMISS_COMMENT\n\n"
COMMENT_BODY+=" 🔹 Dismiss Comment: $DISMISS_COMMENT_SINGLE_LINE\n\n"
done < <(echo "$RESOLVED_ALERTS" | jq -c '.[]')
fi
Expand Down

0 comments on commit 91ed32e

Please sign in to comment.