Skip to content

Commit d160e07

Browse files
committed
chore: update lint workflow to include permissions and improve branch checkout logic
1 parent 54f7c73 commit d160e07

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

.github/workflows/lint.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ on:
1313
jobs:
1414
lint:
1515
runs-on: ubuntu-latest
16+
permissions:
17+
contents: write
18+
pull-requests: write
1619
env:
1720
THUMBNAIL_URL: ${{ vars.THUMBNAIL_URL }}
1821

@@ -48,8 +51,8 @@ jobs:
4851
git config --local user.name "GitHub Action"
4952
# Ensure we're on the correct branch
5053
if [ "${{ github.event_name }}" = "pull_request" ]; then
51-
BRANCH_NAME="pr-${{ github.event.number }}"
52-
git checkout -b $BRANCH_NAME
54+
BRANCH_NAME="${{ github.head_ref }}"
55+
git checkout $BRANCH_NAME || git checkout -b $BRANCH_NAME
5356
else
5457
BRANCH_NAME="${{ github.ref_name }}"
5558
git checkout $BRANCH_NAME || git checkout -b $BRANCH_NAME

0 commit comments

Comments
 (0)