From a56f2dd49273136668ad5e3add522e57976f034a Mon Sep 17 00:00:00 2001 From: Nathan Rajlich Date: Tue, 28 Apr 2026 16:04:26 -0700 Subject: [PATCH 1/3] Pass stale-banner via path: to sticky-pull-request-comment instead of message: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The 'Update existing test comment with stale warning' step inlined the previous comment body via ${{ steps.get-comment.outputs.previous-results }} into the action's `message:` input. As the test matrix grows, the resulting argv can exceed ARG_MAX and the action fails with 'Argument list too long' — observed on a feature branch where the matrix doubled. Write the rendered stale-banner message to $RUNNER_TEMP/stale-comment.md in the github-script step and pass the path to sticky-pull-request-comment via its `path:` input instead. This is robust to any future matrix size. --- .../pr-comment-stale-banner-via-path.md | 2 + .github/workflows/tests.yml | 39 +++++++++++-------- 2 files changed, 25 insertions(+), 16 deletions(-) create mode 100644 .changeset/pr-comment-stale-banner-via-path.md diff --git a/.changeset/pr-comment-stale-banner-via-path.md b/.changeset/pr-comment-stale-banner-via-path.md new file mode 100644 index 0000000000..a845151cc8 --- /dev/null +++ b/.changeset/pr-comment-stale-banner-via-path.md @@ -0,0 +1,2 @@ +--- +--- diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f9be227c8d..73ddc2f6ff 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -38,8 +38,11 @@ jobs: if: steps.find-comment.outputs.comment-id != '' id: get-comment uses: actions/github-script@v7 + env: + STARTED_AT: ${{ github.event.pull_request.updated_at }} with: script: | + const fs = require('fs'); const comment = await github.rest.issues.getComment({ owner: context.repo.owner, repo: context.repo.repo, @@ -49,15 +52,32 @@ jobs: // Check if there are actual results (tables) if (body.includes('|') && body.includes('Passed')) { // Extract results section (everything after header) - let resultsSection = body + const resultsSection = body .replace(/\n## 🧪 E2E Test Results\n\n> ⚠️ \*\*Results below are stale\*\*[^\n]*\n\n/g, '') .replace(/\n## 🧪 E2E Test Results\n\n/g, '') .replace(/⏳ \*\*Tests are running\.\.\.\*\*\n\n---\n_Started at:[^_]*_\n\n---\n\n/g, '') .replace(/⏳ \*\*Tests are running\.\.\.\*\*\n\n---\n_Started at:[^_]*_/g, '') .trim(); if (resultsSection && resultsSection.includes('|')) { + // Write the full stale-banner message to disk and pass the + // path to the sticky-pull-request-comment action below. + // Inlining the previous results via `message:` blew past + // ARG_MAX once the matrix doubled (snapshot + replay). + const startedAt = process.env.STARTED_AT; + const message = + '\n' + + '## 🧪 E2E Test Results\n\n' + + '> ⚠️ **Results below are stale** and not from the latest commit. This comment will be updated when CI completes on the latest run.\n\n' + + '⏳ **Tests are running...**\n\n' + + '---\n' + + `_Started at: ${startedAt}_\n\n` + + '---\n\n' + + resultsSection + + '\n'; + const path = `${process.env.RUNNER_TEMP}/stale-comment.md`; + fs.writeFileSync(path, message); core.setOutput('has-results', 'true'); - core.setOutput('previous-results', resultsSection); + core.setOutput('stale-comment-path', path); } else { core.setOutput('has-results', 'false'); } @@ -86,20 +106,7 @@ jobs: uses: marocchino/sticky-pull-request-comment@v2 with: header: e2e-test-results - message: | - - ## 🧪 E2E Test Results - - > ⚠️ **Results below are stale** and not from the latest commit. This comment will be updated when CI completes on the latest run. - - ⏳ **Tests are running...** - - --- - _Started at: ${{ github.event.pull_request.updated_at }}_ - - --- - - ${{ steps.get-comment.outputs.previous-results }} + path: ${{ steps.get-comment.outputs.stale-comment-path }} - name: Update existing test comment without results if: steps.find-comment.outputs.comment-id != '' && steps.get-comment.outputs.has-results != 'true' From 9d900c586123a03c842d98dbe5ca25684952f3be Mon Sep 17 00:00:00 2001 From: Nathan Rajlich Date: Fri, 1 May 2026 02:18:30 -0700 Subject: [PATCH 2/3] Apply same fix to benchmarks.yml Same ARG_MAX hazard exists in the benchmark workflow's stale-warning step. Apply the identical `path:`-instead-of-`message:` refactor: - The github-script step now writes the rendered stale-banner to $RUNNER_TEMP/stale-comment.md and exposes the path as a step output. - The sticky-pull-request-comment 'Update existing benchmark comment with stale warning' step uses `path:` instead of inlining ${{ steps.get-comment.outputs.previous-results }} via `message:`. The final 'Update PR comment with results' step in this workflow already used `path: benchmark-summary.md`; only the stale-banner update was inlined. --- .github/workflows/benchmarks.yml | 39 +++++++++++++++++++------------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index 28e159c706..4ff8120e94 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -39,8 +39,11 @@ jobs: if: steps.find-comment.outputs.comment-id != '' id: get-comment uses: actions/github-script@v7 + env: + STARTED_AT: ${{ github.event.pull_request.updated_at }} with: script: | + const fs = require('fs'); const comment = await github.rest.issues.getComment({ owner: context.repo.owner, repo: context.repo.repo, @@ -49,7 +52,7 @@ jobs: // Extract the results section (everything after the header and running message) const body = comment.data.body; // Remove any existing stale warning and running message - let resultsSection = body + const resultsSection = body .replace(/\n## 📊 Benchmark Results\n\n> ⚠️ \*\*Results below are stale\*\*[^\n]*\n\n/g, '') .replace(/\n## 📊 Benchmark Results\n\n/g, '') .replace(/⏳ \*\*Benchmarks are running\.\.\.\*\*\n\n---\n_Started at:[^_]*_\n\n---\n\n/g, '') @@ -58,8 +61,25 @@ jobs: // If there's actual content left (benchmark tables), save it if (resultsSection && resultsSection.includes('|')) { + // Write the full stale-banner message to disk and pass the + // path to the sticky-pull-request-comment action below. + // Inlining the previous results via `message:` blew past + // ARG_MAX once the benchmark tables grew large enough. + const startedAt = process.env.STARTED_AT; + const message = + '\n' + + '## 📊 Benchmark Results\n\n' + + '> ⚠️ **Results below are stale** and not from the latest commit. This comment will be updated when CI completes on the latest run.\n\n' + + '⏳ **Benchmarks are running...**\n\n' + + '---\n' + + `_Started at: ${startedAt}_\n\n` + + '---\n\n' + + resultsSection + + '\n'; + const path = `${process.env.RUNNER_TEMP}/stale-comment.md`; + fs.writeFileSync(path, message); core.setOutput('has-results', 'true'); - core.setOutput('previous-results', resultsSection); + core.setOutput('stale-comment-path', path); } else { core.setOutput('has-results', 'false'); } @@ -85,20 +105,7 @@ jobs: uses: marocchino/sticky-pull-request-comment@v2 with: header: benchmark-results - message: | - - ## 📊 Benchmark Results - - > ⚠️ **Results below are stale** and not from the latest commit. This comment will be updated when CI completes on the latest run. - - ⏳ **Benchmarks are running...** - - --- - _Started at: ${{ github.event.pull_request.updated_at }}_ - - --- - - ${{ steps.get-comment.outputs.previous-results }} + path: ${{ steps.get-comment.outputs.stale-comment-path }} - name: Update existing benchmark comment without results if: steps.find-comment.outputs.comment-id != '' && steps.get-comment.outputs.has-results != 'true' From 5b3d6ab56c20e93d669b096aa1ab388a4a5552c8 Mon Sep 17 00:00:00 2001 From: Nathan Rajlich Date: Sun, 3 May 2026 10:36:28 -0700 Subject: [PATCH 3/3] Use `github.run_started_at` for stale-comment timestamps MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The 'Started at:' label was sourced from `github.event.pull_request.updated_at`, which is the PR metadata-update timestamp — not the workflow run start time. That made the displayed timestamp: - coupled to PR edits (label changes, description edits, etc.) rather than to the actual CI run, and - stale on workflow re-runs (an empty re-run would still show the original PR-update time). Switch all six occurrences across `tests.yml` and `benchmarks.yml` to `github.run_started_at`, the canonical "this CI run started at" timestamp. --- .github/workflows/benchmarks.yml | 6 +++--- .github/workflows/tests.yml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index 4ff8120e94..ae42b33ad7 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -40,7 +40,7 @@ jobs: id: get-comment uses: actions/github-script@v7 env: - STARTED_AT: ${{ github.event.pull_request.updated_at }} + STARTED_AT: ${{ github.run_started_at }} with: script: | const fs = require('fs'); @@ -98,7 +98,7 @@ jobs: This comment will be updated with the results when the benchmarks complete. --- - _Started at: ${{ github.event.pull_request.updated_at }}_ + _Started at: ${{ github.run_started_at }}_ - name: Update existing benchmark comment with stale warning if: steps.find-comment.outputs.comment-id != '' && steps.get-comment.outputs.has-results == 'true' @@ -121,7 +121,7 @@ jobs: This comment will be updated with the results when the benchmarks complete. --- - _Started at: ${{ github.event.pull_request.updated_at }}_ + _Started at: ${{ github.run_started_at }}_ # Phase 1: Build all packages (not workbenches) build: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 73ddc2f6ff..8731837e56 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -39,7 +39,7 @@ jobs: id: get-comment uses: actions/github-script@v7 env: - STARTED_AT: ${{ github.event.pull_request.updated_at }} + STARTED_AT: ${{ github.run_started_at }} with: script: | const fs = require('fs'); @@ -99,7 +99,7 @@ jobs: This comment will be updated with the results when the tests complete. --- - _Started at: ${{ github.event.pull_request.updated_at }}_ + _Started at: ${{ github.run_started_at }}_ - name: Update existing test comment with stale warning if: steps.find-comment.outputs.comment-id != '' && steps.get-comment.outputs.has-results == 'true' @@ -122,7 +122,7 @@ jobs: This comment will be updated with the results when the tests complete. --- - _Started at: ${{ github.event.pull_request.updated_at }}_ + _Started at: ${{ github.run_started_at }}_ unit: name: Unit Tests (${{ matrix.os }})