Skip to content

Commit 6081635

Browse files
committed
Update Prettier GitHub Actions
1 parent a811af1 commit 6081635

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

.github/workflows/prettier.yml

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ name: Prettier
33

44
on:
55
push:
6-
# pull_request:
7-
# branches: [master, main]
6+
pull_request:
7+
branches: [master, main]
88

99
jobs:
1010
prettier:
@@ -16,7 +16,22 @@ jobs:
1616
with:
1717
ref: ${{ github.head_ref }}
1818

19+
- name: Cache Node Modules
20+
uses: actions/cache@v3
21+
id: node_modules_cache_id
22+
with:
23+
path: "**/node_modules"
24+
key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
25+
26+
- name: Install Node Mudules
27+
if: steps.node_modules_cache_id.outputs.cache-hit != 'true'
28+
run: npm ci
29+
shell: bash
30+
1931
- name: Run Prettier
20-
uses: creyD/prettier_action@v4.2
32+
run: npx prettier --write .
33+
34+
- name: Commit
35+
uses: stefanzweifel/git-auto-commit-action@v4
2136
with:
22-
prettier_options: --write .
37+
commit_message: Formatted!

0 commit comments

Comments
 (0)