From 7862ae4b652a4491345bfc643590747dfaa150f1 Mon Sep 17 00:00:00 2001 From: snomiao Date: Wed, 3 Sep 2025 06:41:43 +0900 Subject: [PATCH] [bugfix] Fix lint-and-format workflow detached HEAD issue (#5305) * [bugfix] Fix lint-and-format workflow detached HEAD issue - Changed checkout ref from head.sha to head.ref to properly checkout PR branch - This fixes the 'fatal: You are not currently on a branch' error when pushing auto-fixes - The workflow was failing because it was in detached HEAD state and couldn't push commits * [test] Intentionally break formatting to test CI/CD auto-fix * [auto-fix] Apply ESLint and Prettier fixes --------- Co-authored-by: GitHub Action --- .github/workflows/lint-and-format.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint-and-format.yaml b/.github/workflows/lint-and-format.yaml index b715328db..3b6bf1538 100644 --- a/.github/workflows/lint-and-format.yaml +++ b/.github/workflows/lint-and-format.yaml @@ -16,7 +16,7 @@ jobs: uses: actions/checkout@v4 with: token: ${{ secrets.GITHUB_TOKEN }} - ref: ${{ github.event.pull_request.head.sha }} + ref: ${{ github.event.pull_request.head.ref }} fetch-depth: 0 - name: Install pnpm