From 6e8cfb0eb46624a09b41bab107ac7f4ae4b06f70 Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Thu, 7 May 2026 15:27:13 -0400 Subject: [PATCH] ci(ui-preview-smoke): checkout base branch before agent runs The new ui-preview-smoke workflow exits early with `fatal: not in a git directory` because claude-code-action configures `git config user.name` as one of its first steps and needs a valid working tree. Add `actions/checkout@v4` pinned to the repo's default branch (not the PR head ref) so we satisfy the action's requirement without executing fork-supplied code under pull_request_target. The smoke test only drives Playwright at the deployed Vercel preview, so PR code is never needed in the runner. --- .github/workflows/ui-preview-smoke.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/ui-preview-smoke.yml b/.github/workflows/ui-preview-smoke.yml index da192552c7..a2e4b13e1c 100644 --- a/.github/workflows/ui-preview-smoke.yml +++ b/.github/workflows/ui-preview-smoke.yml @@ -31,6 +31,17 @@ jobs: actions: read steps: + # claude-code-action requires a valid git working tree (it configures + # git user before running). We only drive Playwright at the Vercel + # preview URL — we never execute repo code — so checking out the base + # branch is sufficient and avoids running any fork-supplied code under + # pull_request_target. + - name: Checkout base branch + uses: actions/checkout@v4 + with: + ref: ${{ github.event.repository.default_branch }} + persist-credentials: false + - name: Resolve PR metadata + body id: pr uses: actions/github-script@v9