Skip to content

Commit 3eadce6

Browse files
committed
Create prettier.yml
1 parent 5240a04 commit 3eadce6

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

.github/workflows/prettier.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
name: Prettier
3+
4+
on:
5+
push:
6+
branches: [main]
7+
workflow_dispatch:
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
run:
15+
name: 🤔
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # tag=v3
19+
- uses: actions/setup-node@8c91899e586c5b171469028077307d293428b516 # tag=v3
20+
with:
21+
cache: npm
22+
node-version: lts/*
23+
- run: npm ci --ignore-scripts --only-dev
24+
- uses: actions/cache@9b0c1fce7a93df8e3bb8926b0d6e9d89e92f20a7 # v3
25+
with:
26+
path: node_modules/.cache/prettier/.prettier-cache
27+
key: prettier-${{ hashFiles('package-lock.json') }}-${{ hashFiles('.gitignore') }}
28+
- name: check if workflows needs prettier
29+
run: npx prettier --cache --check ".github/workflows/**/*.yml" || (echo "An action can't make changes to actions, you'll have to run prettier manually" && exit 1)
30+
- run: npx prettier --ignore-path .gitignore --cache --write .
31+
- uses: EndBug/add-and-commit@61a88be553afe4206585b31aa72387c64295d08b # tag=v9
32+
with:
33+
default_author: github_actions
34+
commit: --no-verify
35+
message: 'chore(prettier): 🤖 ✨'

0 commit comments

Comments
 (0)