-
Notifications
You must be signed in to change notification settings - Fork 2
34 lines (32 loc) · 1 KB
/
prettier-check.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
name: Validate Code Formatting
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
validate-code-formatting:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v2
- run: yarn
# Example output when there are unformatted files:
#
# yarn run v1.22.11
# $ /../password-ga/node_modules/.bin/prettier --check src
# Checking formatting...
# [warn] src/App.js
# [warn] Code style issues found in the above file(s). Forgot to run Prettier?
# error Command failed with exit code 1.
# info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
#
# Example output when all files are formatted, this will exit with code 0:
#
# yarn run v1.22.11
# $ /../password-ga/node_modules/.bin/prettier --check src
# Checking formatting...
# All matched files use Prettier code style!
- run: yarn prettier --check src