infra/workflow: Only comment if there is output

This commit is contained in:
Josh Soref 2024-06-28 09:55:32 -04:00 committed by Hermet Park
parent 57cdff0d9e
commit af0cb93836
2 changed files with 8 additions and 8 deletions

View file

@ -27,10 +27,10 @@ if [[ "$GITHUB_EVENT_NAME" == "pull_request" ]]; then
OUTPUT+=$'\n```\n' OUTPUT+=$'\n```\n'
OUTPUT+="$PAYLOAD_MEMCHECK" OUTPUT+="$PAYLOAD_MEMCHECK"
OUTPUT+=$'\n```\n' OUTPUT+=$'\n```\n'
PAYLOAD=$(echo '{}' | jq --arg body "$OUTPUT" '.body = $body')
curl -s -S -H "Authorization: token $GITHUB_TOKEN" --header "Content-Type: application/vnd.github.VERSION.text+json" --data "$PAYLOAD" "$COMMENTS_URL"
fi fi
PAYLOAD=$(echo '{}' | jq --arg body "$OUTPUT" '.body = $body')
curl -s -S -H "Authorization: token $GITHUB_TOKEN" --header "Content-Type: application/vnd.github.VERSION.text+json" --data "$PAYLOAD" "$COMMENTS_URL"
fi fi

View file

@ -26,10 +26,10 @@ if [[ "$GITHUB_EVENT_NAME" == "pull_request" ]]; then
OUTPUT+=$'\n```\n' OUTPUT+=$'\n```\n'
OUTPUT+="$PAYLOAD_MEMCHECK" OUTPUT+="$PAYLOAD_MEMCHECK"
OUTPUT+=$'\n```\n' OUTPUT+=$'\n```\n'
PAYLOAD=$(echo '{}' | jq --arg body "$OUTPUT" '.body = $body')
curl -s -S -H "Authorization: token $GITHUB_TOKEN" --header "Content-Type: application/vnd.github.VERSION.text+json" --data "$PAYLOAD" "$COMMENTS_URL"
fi fi
PAYLOAD=$(echo '{}' | jq --arg body "$OUTPUT" '.body = $body')
curl -s -S -H "Authorization: token $GITHUB_TOKEN" --header "Content-Type: application/vnd.github.VERSION.text+json" --data "$PAYLOAD" "$COMMENTS_URL"
fi fi