File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -444,12 +444,15 @@ jobs:
444444 REJECTED=$(echo "$RESPONSE" | jq '[.[] | select(.state == "rejected")] | length')
445445 if [ "$REJECTED" -gt 0 ]; then
446446 echo "was_rejected=true" >> "$GITHUB_OUTPUT"
447- COMMENT=$(echo "$RESPONSE" | jq -r '.[] | select(.state == "rejected") | .comment // empty' | head -1 )
447+ COMMENT=$(echo "$RESPONSE" | jq -r '[ .[] | select(.state == "rejected") | .comment // empty] | first // empty' )
448448 if [ -n "$COMMENT" ]; then
449+ # Random delimiter so reviewer-controlled comment text can never
450+ # terminate the heredoc early and truncate the output.
451+ delimiter="msg_$(openssl rand -hex 16)"
449452 {
450- echo ' message<<EOF'
453+ echo " message<<$delimiter"
451454 echo "🚫 Release was rejected: $COMMENT"
452- echo 'EOF'
455+ echo "$delimiter"
453456 } >> "$GITHUB_OUTPUT"
454457 else
455458 echo "message=🚫 Release was rejected." >> "$GITHUB_OUTPUT"
You can’t perform that action at this time.
0 commit comments