generated from sarioglu/svelte-tailwindcss-template
-
Notifications
You must be signed in to change notification settings - Fork 3
42 lines (36 loc) · 1.05 KB
/
formatting_test.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: Formatting validator
on: push
jobs:
formatting-validator:
name: Prettier validation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ""
submodules: true
- name: Setup NodeJs
uses: actions/setup-node@v3
with:
node-version: "18.16.1"
- name: Install dependencies
run: |
npm i
npm run format
git status
touch format_error.txt
echo 'Changed Files:'
git diff --name-only
git diff --name-only >> format_error.txt
if [ -s format_error.txt ]; then
echo "ERROR IN FORMATTING, PLEASE RUN PRETTIER ON THE CODEBASE BEFORE COMMITTING"
echo "Files:"
cat format_error.txt
exit 1
fi
- uses: tsickert/[email protected]
if: ${{ failure() }}
with:
webhook-url: ${{ secrets.DISCORD_DEV_WEBHOOK }}
content: "Format error in the following files!"
filename: "format_error.txt"