Skip to content

Commit 8eb0065

Browse files
authored
Update lint workflow and add auto-commit for fixes
1 parent 41063ef commit 8eb0065

File tree

1 file changed

+25
-9
lines changed

1 file changed

+25
-9
lines changed

.github/workflows/lint.yml

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,32 @@ jobs:
1717
THUMBNAIL_URL: ${{ vars.THUMBNAIL_URL }}
1818

1919
steps:
20-
- name: Checkout code
21-
uses: actions/checkout@v3
22-
23-
- name: Set up Bun
24-
run: |
25-
curl -fsSL https://bun.sh/install | bash
26-
echo "${HOME}/.bun/bin" >> $GITHUB_PATH
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
23+
- name: Install bun
24+
uses: oven-sh/setup-bun@v2
2725

2826
- name: Install dependencies
2927
run: bun install
3028

31-
- name: Run linter
32-
run: bun run lint
29+
- name: Install dependencies # (assuming your project has dependencies)
30+
run: bun install # You can use npm/yarn/pnpm instead if you prefer
31+
32+
- name: Check for changes
33+
id: verify-changed-files
34+
run: |
35+
if [ -n "$(git status --porcelain)" ]; then
36+
echo "changed=true" >> $GITHUB_OUTPUT
37+
else
38+
echo "changed=false" >> $GITHUB_OUTPUT
39+
fi
40+
41+
- name: Commit linter changes
42+
if: steps.verify-changed-files.outputs.changed == 'true'
43+
run: |
44+
git config --local user.email "[email protected]"
45+
git config --local user.name "GitHub Action"
46+
git add .
47+
git commit -m "🔧 Auto-fix: ESLint formatting and fixes"
48+
git push

0 commit comments

Comments
 (0)