-
Notifications
You must be signed in to change notification settings - Fork 960
42 lines (33 loc) · 1023 Bytes
/
format.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
name: Format
on:
push:
branches:
- main
jobs:
format:
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.9.1
- name: Checkout Repository
uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: 14
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Format
run: npm run format --if-present
- name: Commit
run: |
git config --local user.email "github-actions@remix.run"
git config --local user.name "Remix Run Bot"
git add .
if [ -z "$(git status --porcelain)" ]; then
echo "💿 no formatting changed"
exit 0
fi
git commit -m "chore: format" -m "formatted $GITHUB_SHA"
git push
echo "💿 pushed formatting changes https://github.com/$GITHUB_REPOSITORY/commit/$(git rev-parse HEAD)"