From 282f0e6412be92dfcda97474ec59053bb8437f02 Mon Sep 17 00:00:00 2001 From: Martin Vogel Date: Sun, 25 Oct 2026 18:40:50 +0100 Subject: [PATCH] fix(ci): post the PR acknowledgement without its hidden maintainer note The template opens with an HTML-comment note for maintainers, and the workflow posted the file verbatim, so every acknowledgement comment carried text a contributor cannot see but a tool reads. Our own PR screening holds every comment with such hidden text, which parked nine contributor PRs on a note we wrote ourselves. Strip HTML comments (an unterminated one runs to the end, as GitHub renders it) into a temporary body file and post that. The posted text is byte-identical to what rendered before. A template whose only content is the note now counts as blank, which is the documented off switch. Signed-off-by: Martin Vogel --- .github/workflows/pr-acknowledgement.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pr-acknowledgement.yml b/.github/workflows/pr-acknowledgement.yml index ef36a9fb0..760483abb 100644 --- a/.github/workflows/pr-acknowledgement.yml +++ b/.github/workflows/pr-acknowledgement.yml @@ -51,17 +51,25 @@ jobs: run: | set -euo pipefail MESSAGE_FILE=.github/pr-acknowledgement.md + BODY_FILE="$RUNNER_TEMP/pr-acknowledgement-body.md" if [ ! -f "$MESSAGE_FILE" ]; then echo "No $MESSAGE_FILE in the base tree — acknowledgements are off." exit 0 fi - # An empty or whitespace-only file is the documented off switch. - if [ -z "$(tr -d '[:space:]' < "$MESSAGE_FILE")" ]; then - echo "$MESSAGE_FILE is blank — acknowledgements are off." + # HTML comments in the template are notes for maintainers. Posted + # verbatim they become text a reader cannot see but a tool can, and + # our own PR screening holds every comment that carries hidden text. + # Strip them (an unterminated one runs to the end, as GitHub renders + # it) so the posted body is exactly what the contributor sees. + perl -0777 -pe 's/|\z)[ \t]*\n?//gs' "$MESSAGE_FILE" > "$BODY_FILE" + + # A body with no visible text is the documented off switch. + if [ -z "$(tr -d '[:space:]' < "$BODY_FILE")" ]; then + echo "$MESSAGE_FILE has no visible text — acknowledgements are off." exit 0 fi - gh pr comment "$PR_NUMBER" --repo "$REPO" --body-file "$MESSAGE_FILE" + gh pr comment "$PR_NUMBER" --repo "$REPO" --body-file "$BODY_FILE" echo "Acknowledged PR #${PR_NUMBER}."