From ed5d3d012485db94ba8a9e36d548e33f4fb70ee4 Mon Sep 17 00:00:00 2001 From: fern-bot <174841662+fern-bot@users.noreply.github.com> Date: Tue, 12 May 2026 20:18:36 +0000 Subject: [PATCH 1/2] ci: replace thollander/actions-comment-pull-request with inline `gh api` The third-party action was the only piece of preview-docs still pinned to Node.js 20 (its action runtime). Replacing it with a self-contained `gh api` upsert removes the dependency entirely and silences the last remaining Node 20 deprecation warning emitted by the runner. The upsert preserves the existing behavior: comments are deduplicated by looking up a hidden HTML marker in the PR comment body and either PATCHing the existing comment or POSTing a new one. --- .github/workflows/preview-docs.yml | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/.github/workflows/preview-docs.yml b/.github/workflows/preview-docs.yml index 159ba6a..13ca87b 100644 --- a/.github/workflows/preview-docs.yml +++ b/.github/workflows/preview-docs.yml @@ -78,8 +78,26 @@ jobs: fi - name: Post PR comment - uses: thollander/actions-comment-pull-request@v2.4.3 - with: - filePath: comment.md - comment_tag: preview-docs - mode: upsert + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + PR_NUMBER: ${{ github.event.pull_request.number }} + REPO: ${{ github.repository }} + run: | + MARKER="" + { + cat comment.md + printf '\n%s\n' "$MARKER" + } > comment-with-marker.md + + # Upsert by looking up an existing comment that carries our hidden marker. + EXISTING_ID=$(gh api --paginate \ + "repos/$REPO/issues/$PR_NUMBER/comments" \ + --jq "[.[] | select(.body | contains(\"$MARKER\"))][0].id // empty") + + jq -Rn --rawfile body comment-with-marker.md '{body: $body}' > payload.json + + if [ -n "$EXISTING_ID" ]; then + gh api -X PATCH "repos/$REPO/issues/comments/$EXISTING_ID" --input payload.json + else + gh api -X POST "repos/$REPO/issues/$PR_NUMBER/comments" --input payload.json + fi From fee862bdcb86f3dd424b5409d7daa0272ec6ad9f Mon Sep 17 00:00:00 2001 From: fern-bot <174841662+fern-bot@users.noreply.github.com> Date: Tue, 12 May 2026 20:20:34 +0000 Subject: [PATCH 2/2] ci: trigger preview-docs re-run to validate comment upsert