Skip to content

Commit 54f7c73

Browse files
committed
chore: update lint workflow to ensure correct branch handling and set fetch depth
1 parent 131366a commit 54f7c73

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

.github/workflows/lint.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ jobs:
2121
uses: actions/checkout@v4
2222
with:
2323
token: ${{ secrets.GITHUB_TOKEN }}
24+
fetch-depth: 0
2425

2526
- name: Install bun
2627
uses: oven-sh/setup-bun@v2
@@ -45,6 +46,14 @@ jobs:
4546
run: |
4647
git config --local user.email "[email protected]"
4748
git config --local user.name "GitHub Action"
49+
# Ensure we're on the correct branch
50+
if [ "${{ github.event_name }}" = "pull_request" ]; then
51+
BRANCH_NAME="pr-${{ github.event.number }}"
52+
git checkout -b $BRANCH_NAME
53+
else
54+
BRANCH_NAME="${{ github.ref_name }}"
55+
git checkout $BRANCH_NAME || git checkout -b $BRANCH_NAME
56+
fi
4857
git add .
4958
git commit -m "🔧 Auto-fix: ESLint formatting and fixes"
50-
git push
59+
git push origin $BRANCH_NAME

0 commit comments

Comments
 (0)