Skip to content

Commit 966e86a

Browse files
ci: format and auto-commit diffs instead of just checking (#320)
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: ben@e2b.dev <ben@e2b.dev>
1 parent 07da540 commit 966e86a

1 file changed

Lines changed: 15 additions & 2 deletions

File tree

.github/workflows/code-quality.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,16 @@ jobs:
4444
format:
4545
name: Format
4646
runs-on: ubuntu-latest
47+
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
48+
permissions:
49+
contents: write
4750

4851
steps:
4952
- name: Checkout code
5053
uses: actions/checkout@v4
54+
with:
55+
ref: ${{ github.head_ref }}
56+
token: ${{ secrets.GITHUB_TOKEN }}
5157

5258
- name: Setup Bun
5359
uses: oven-sh/setup-bun@v2
@@ -65,8 +71,15 @@ jobs:
6571
- name: Install dependencies
6672
run: bun install
6773

68-
- name: Run format check
69-
run: bunx biome ci --formatter-enabled=true --assist-enabled=true --linter-enabled=false --reporter=github .
74+
- name: Run formatter
75+
run: bun run format
76+
77+
- name: Commit formatting changes
78+
uses: stefanzweifel/git-auto-commit-action@v5
79+
with:
80+
commit_message: "style: apply biome formatting"
81+
commit_user_name: "github-actions[bot]"
82+
commit_user_email: "41898282+github-actions[bot]@users.noreply.github.com"
7083

7184
knip:
7285
name: Knip

0 commit comments

Comments
 (0)