[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 <action@github.com>
This commit is contained in:
snomiao
2025-09-03 06:41:43 +09:00
committed by GitHub
parent 8f7ee4e9a3
commit 7862ae4b65

View File

@@ -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