File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -51,17 +51,25 @@ jobs:
5151 run: |
5252 set -euo pipefail
5353 MESSAGE_FILE=.github/pr-acknowledgement.md
54+ BODY_FILE="$RUNNER_TEMP/pr-acknowledgement-body.md"
5455
5556 if [ ! -f "$MESSAGE_FILE" ]; then
5657 echo "No $MESSAGE_FILE in the base tree — acknowledgements are off."
5758 exit 0
5859 fi
5960
60- # An empty or whitespace-only file is the documented off switch.
61- if [ -z "$(tr -d '[:space:]' < "$MESSAGE_FILE")" ]; then
62- echo "$MESSAGE_FILE is blank — acknowledgements are off."
61+ # HTML comments in the template are notes for maintainers. Posted
62+ # verbatim they become text a reader cannot see but a tool can, and
63+ # our own PR screening holds every comment that carries hidden text.
64+ # Strip them (an unterminated one runs to the end, as GitHub renders
65+ # it) so the posted body is exactly what the contributor sees.
66+ perl -0777 -pe 's/<!--.*?(?:-->|\z)[ \t]*\n?//gs' "$MESSAGE_FILE" > "$BODY_FILE"
67+
68+ # A body with no visible text is the documented off switch.
69+ if [ -z "$(tr -d '[:space:]' < "$BODY_FILE")" ]; then
70+ echo "$MESSAGE_FILE has no visible text — acknowledgements are off."
6371 exit 0
6472 fi
6573
66- gh pr comment "$PR_NUMBER" --repo "$REPO" --body-file "$MESSAGE_FILE "
74+ gh pr comment "$PR_NUMBER" --repo "$REPO" --body-file "$BODY_FILE "
6775 echo "Acknowledged PR #${PR_NUMBER}."
You can’t perform that action at this time.
0 commit comments