Skip to content

Commit 5b32142

Browse files
authored
Merge pull request hestiacp#4253 from hestiacp/auto-prettier
Auto fix PRs that fail Prettier
2 parents 0dc1f44 + 2df2bda commit 5b32142

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

.github/workflows/lint.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ jobs:
3939
steps:
4040
- name: Checkout code
4141
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
42+
with:
43+
repository: ${{ github.event.pull_request.head.repo.full_name }}
44+
ref: ${{ github.event.pull_request.head.ref }}
4245

4346
- name: Setup Node
4447
uses: actions/setup-node@b39b52d1213e96004bfcb1c61a8a6fa8ab84f3e8 # v4
@@ -48,9 +51,21 @@ jobs:
4851
- name: Install Node packages
4952
run: npm ci --ignore-scripts
5053

51-
- name: Run Prettier
54+
- name: Check formatting
5255
run: npx prettier --check .
5356

57+
- name: Apply formatting
58+
if: github.event_name == 'pull_request'
59+
run: npm run format
60+
61+
- name: Commit formatting changes
62+
if: github.event_name == 'pull_request'
63+
uses: EndBug/add-and-commit@v9
64+
with:
65+
default_author: github_actions
66+
message: Apply Prettier formatting
67+
add: "."
68+
5469
eslint:
5570
name: ESLint
5671
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)