From ef46f0cbf4cb26cb58957e5d294ac94eea6d3cf6 Mon Sep 17 00:00:00 2001 From: Christian Byrne Date: Wed, 12 Nov 2025 13:58:02 -0800 Subject: [PATCH] ci: fix action that comments on Release PRs (#6663) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes issues with the action that comments updates on merged release PRs: 1. Multi-line LINKS_VALUE: Use '%s\n%s' command substitution instead of literal newline 2. Heredoc delimiter: Changed to COMMENT_BODY_END_MARKER without quotes 3. Variable bug: Fixed incorrect variable (`$URL` not `$URL_TEMPLATE`) 4. Change from `printf` to `echo` (avoid weird printf gymnastics) ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-6663-ci-fix-action-that-comments-on-Release-PRs-2a96d73d365081b1b0c5c8e66f0e317f) by [Unito](https://www.unito.io) --- .../actions/comment-release-links/action.yaml | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/.github/actions/comment-release-links/action.yaml b/.github/actions/comment-release-links/action.yaml index 8b71f7154..2c31f080c 100644 --- a/.github/actions/comment-release-links/action.yaml +++ b/.github/actions/comment-release-links/action.yaml @@ -28,7 +28,7 @@ runs: REPO="${{ github.repository }}" if [[ -z "$VERSION_FILE" ]]; then - echo '::error::version_file input is required' >&2 + echo "::error::version_file input is required" >&2 exit 1 fi @@ -55,7 +55,9 @@ runs: case "$VERSION_FILE" in package.json) - LINKS_VALUE=$'PyPI|https://pypi.org/project/comfyui-frontend-package/{{version}}/\n''npm types|https://npm.im/@comfyorg/comfyui-frontend-types@{{version}}' + LINKS_VALUE=$(printf '%s\n%s' \ + 'PyPI|https://pypi.org/project/comfyui-frontend-package/{{version}}/' \ + 'npm types|https://npm.im/@comfyorg/comfyui-frontend-types@{{version}}') ;; apps/desktop-ui/package.json) MARKER='desktop-release-summary' @@ -69,12 +71,13 @@ runs: COMMENT_FILE=$(mktemp) { - printf '\n' "$MARKER" "$DIFF_PREFIX" "$NEW_VERSION" - printf '%s\n\n' "$MESSAGE" - printf -- '- %s: [%s%s...%s%s](%s)\n' "$DIFF_LABEL" "$DIFF_PREFIX" "$PREV_VERSION" "$DIFF_PREFIX" "$NEW_VERSION" "$DIFF_URL" + echo "" + echo "$MESSAGE" + echo "" + echo "- $DIFF_LABEL: [$DIFF_PREFIX$PREV_VERSION...$DIFF_PREFIX$NEW_VERSION]($DIFF_URL)" while IFS= read -r RAW_LINE; do - LINE=$(printf '%s' "$RAW_LINE" | sed 's/^[[:space:]]*//;s/[[:space:]]*$//') + LINE=$(echo "$RAW_LINE" | sed 's/^[[:space:]]*//;s/[[:space:]]*$//') [[ -z "$LINE" ]] && continue if [[ "$LINE" != *"|"* ]]; then echo "::warning::Skipping malformed link entry: $LINE" >&2 @@ -84,16 +87,16 @@ runs: URL_TEMPLATE=${LINE#*|} URL=${URL_TEMPLATE//\{\{version\}\}/$NEW_VERSION} URL=${URL//\{\{prev_version\}\}/$PREV_VERSION} - printf -- '- %s: %s\n' "$LABEL" "$URL" + echo "- $LABEL: $URL" done <<< "$LINKS_VALUE" - printf '\n' + echo "" } > "$COMMENT_FILE" { - echo "body<<'EOF'" + echo "body<> "$GITHUB_OUTPUT" echo "prev_version=$PREV_VERSION" >> "$GITHUB_OUTPUT" echo "marker_search=