-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (34 loc) · 1.01 KB
/
reformat-and-lint.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
name: Reformat and Lint
on:
pull_request:
workflow_dispatch:
jobs:
reformat-and-lint:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: 🛎 Checkout
if: github.event.pull_request.user.login != 'dependabot[bot]'
uses: actions/checkout@v3
with:
token: ${{ secrets.WORKFLOW_COMMIT }}
- name: 🤖🛎 Bot Checkout
if: github.event.pull_request.user.login == 'dependabot[bot]'
uses: actions/checkout@v3
- name: 📦 Setup Node.js and caching
uses: actions/setup-node@v3
with:
node-version: 19
cache: "npm"
- name: 🔨 Install
run: npm i
- name: 🧹 Reformat
run: npx prettier --write .
- name: 🚨 Lint
run: npx eslint .
- name: ⬆️ Commit changes
if: github.event.pull_request.user.login != 'dependabot[bot]'
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Reformat and Lint