Skip to content

Conversation

@snomiao
Copy link
Member

@snomiao snomiao commented Sep 2, 2025

Fixes this problem:

image

it works now:

image

Summary

  • Fixed the lint-and-format GitHub Action workflow failing with "fatal: You are not currently on a branch" error
  • Changed checkout ref from head.sha to head.ref to properly checkout the PR branch instead of creating a detached HEAD state

Problem

The workflow was failing in the "Commit changes" step when trying to push auto-fixes because:

  1. Using ref: ${{ github.event.pull_request.head.sha }} checks out a specific commit SHA
  2. This creates a detached HEAD state (not on any branch)
  3. When the workflow tries to git push, it fails because there's no branch to push to

Solution

Changed to ref: ${{ github.event.pull_request.head.ref }} which:

  • Checks out the actual PR branch name
  • Allows the workflow to push commits back to the PR branch
  • Maintains the same security (only works for PRs from the same repo, not forks)

Test Plan

  • Workflow runs successfully on PRs from the same repository
  • Auto-fixes are committed and pushed back to the PR branch
  • Fork PRs still show the manual fix message (unchanged behavior)

Fixes the CI/CD failure seen in #5297

🤖 Generated with Claude Code

Co-Authored-By: Claude [email protected]

┆Issue is synchronized with this Notion page by Unito

- 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
@github-actions
Copy link

github-actions bot commented Sep 2, 2025

🎭 Playwright Test Results

All tests passed across all browsers!

⏰ Completed at: 09/02/2025, 09:21:47 PM UTC

📊 Test Reports by Browser


🎉 Your tests are passing across all browsers!

@snomiao snomiao marked this pull request as ready for review September 2, 2025 20:45
@snomiao snomiao requested a review from a team as a code owner September 2, 2025 20:45
@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Sep 2, 2025
@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. and removed size:XS This PR changes 0-9 lines, ignoring generated files. labels Sep 2, 2025
@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. and removed size:S This PR changes 10-29 lines, ignoring generated files. labels Sep 2, 2025
@github-actions
Copy link

github-actions bot commented Sep 2, 2025

🔧 Auto-fixes Applied

This PR has been automatically updated to fix linting and formatting issues.

⚠️ Important: Your local branch is now behind. Run git pull before making additional changes to avoid conflicts.

Changes made:

  • ESLint auto-fixes
  • Prettier formatting

@christian-byrne christian-byrne merged commit 7862ae4 into main Sep 2, 2025
17 checks passed
@christian-byrne christian-byrne deleted the sno-fix-lint-and-format branch September 2, 2025 21:41
@benceruleanlu benceruleanlu mentioned this pull request Sep 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:CI/CD developer experience size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants