Skip to content

Commit bd0da67

Browse files
committed
ci: enable lint auto-fix and auto-push on main
1 parent 85f2eee commit bd0da67

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ on:
99
jobs:
1010
test:
1111
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write
1214
steps:
1315
- uses: actions/checkout@v4
1416

@@ -19,6 +21,18 @@ jobs:
1921
- name: Install dependencies
2022
run: bun install
2123

24+
- name: Auto-fix linter issues
25+
if: github.event_name == 'push' && github.actor != 'github-actions[bot]'
26+
run: |
27+
bun run lint --fix
28+
if ! git diff --quiet; then
29+
git config user.name "github-actions[bot]"
30+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
31+
git add -A
32+
git commit -m "chore(ci): auto-fix lint"
33+
git push
34+
fi
35+
2236
- name: Run linter
2337
run: bun run lint:all
2438

0 commit comments

Comments
 (0)