From 8521d89893ed2124e8c195c30e7d14443fa62916 Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Mon, 31 Aug 2026 14:57:07 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20slices-comment=20creates=20the=20PR=20co?= =?UTF-8?q?mment=20via=20REST=20=E2=80=94=20the=20write-token=20job=20has?= =?UTF-8?q?=20no=20git=20context?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The token/exec split gives slices-comment NO checkout by design, and gh's pr-comment subcommand resolves the repo FROM git — it died with 'not a git repository' on PR #2746's first run (the update-existing PATCH path was already explicit-repo REST and worked). Create now posts through gh api repos/.../issues/N/comments, and the wiring test pins that no git-context-requiring comment call can creep back into the job. Co-Authored-By: Claude Fable 5 --- .github/workflows/evals.yml | 6 +++++- test/evals-workflow-wiring.test.ts | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/evals.yml b/.github/workflows/evals.yml index 9e250ac3c..71231a87a 100644 --- a/.github/workflows/evals.yml +++ b/.github/workflows/evals.yml @@ -413,5 +413,9 @@ jobs: gh api "repos/${{ github.repository }}/issues/comments/${COMMENT_ID}" \ -X PATCH -f body="$BODY" else - gh pr comment "${{ github.event.pull_request.number }}" --body "$BODY" + # REST, not gh's pr-comment subcommand: this job runs with NO + # checkout (the token/exec split), and that subcommand resolves + # the repo FROM git — it dies with "not a git repository" here. + gh api "repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments" \ + -X POST -f body="$BODY" fi diff --git a/test/evals-workflow-wiring.test.ts b/test/evals-workflow-wiring.test.ts index c49a10a30..921f45881 100644 --- a/test/evals-workflow-wiring.test.ts +++ b/test/evals-workflow-wiring.test.ts @@ -111,6 +111,10 @@ describe('evals.yml sliced-lane wiring (post-matrix)', () => { expect(commentJob).not.toContain('bun install'); expect(commentJob).not.toMatch(/run: .*bun run/); expect(commentJob).not.toContain('uses: ./'); + // No checkout also means no git context: `gh pr comment` resolves the + // repo FROM git and dies with "not a git repository" here (PR #2746's + // first run). Every comment call must be explicit-repo REST (gh api). + expect(commentJob).not.toContain('gh pr comment'); // And the code-executing report job must NOT hold write scopes. const reportJob = evalsYml.slice(evalsYml.indexOf(' slices-report:'), evalsYml.indexOf(' slices-comment:')); expect(reportJob).not.toMatch(/pull-requests: write/);