-
-
Notifications
You must be signed in to change notification settings - Fork 737
36 lines (35 loc) · 1.03 KB
/
fix-formatting.yaml
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
name: Fix formatting
'on':
push:
branches:
- dependabot/npm_and_yarn/prettier-*
- dependabot/npm_and_yarn/eslint-*
workflow_dispatch: {}
permissions:
contents: read
jobs:
fixFormatting:
permissions:
contents: write # for Git to git push
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: true
ref: ${{ github.head_ref }}
- uses: actions/setup-node@v4
with:
node-version: 16
cache: npm
- name: Install dependencies
run: npm ci --ignore-scripts --no-audit --no-progress --prefer-offline
- name: Format
run: npm run format:fix
- name: Commit
run: >
git config user.email "github-actions@github.com"
git config user.name "github-actions"
git add .
git commit -m "style: format files with Prettier" | true # ignore error if there are no changes to commit
git push origin HEAD:${{ github.head_ref }}