File tree Expand file tree Collapse file tree 1 file changed +19
-10
lines changed Expand file tree Collapse file tree 1 file changed +19
-10
lines changed Original file line number Diff line number Diff line change @@ -37,25 +37,34 @@ jobs:
37
37
exit 1
38
38
fi
39
39
prettier :
40
- name : Prettier Check
41
40
runs-on : ubuntu-latest
42
41
steps :
43
42
- uses : GitHubSecurityLab/actions-permissions/monitor@v1
44
43
with :
45
44
config : ${{ vars.PERMISSIONS_CONFIG }}
46
45
- name : Checkout Repository
47
46
uses : actions/checkout@v2
48
- - name : Run Prettier
49
- id : prettier-run
50
- uses : rutajdash/prettier-cli-action@d42c4325a3b344f3bd4be482bc34de521998d557
47
+ - uses : actions/setup-node@v4
51
48
with :
52
- config_path : ./.prettierrc.yml
53
- - name : Prettier Output
54
- if : ${{ failure() }}
55
- shell : bash
49
+ node-version-file : package.json
50
+ - name : install dependencies
56
51
run : |
57
- echo "The following files are not formatted:"
58
- echo "${{steps.prettier-run.outputs.prettier_output}}"
52
+ npm ci
53
+ - run : |
54
+ npm run reformat
55
+ - name : Check for uncommitted files
56
+ run : |
57
+ export FILES=
58
+ FILES=$(git ls-files -o -m --directory --exclude-standard --no-empty-directory)
59
+ export LINES=
60
+ LINES=$(echo "$FILES" | awk 'NF' | wc -l)
61
+ if [ "$LINES" -ne 0 ]; then
62
+ echo "Detected files that need to be committed:"
63
+ echo "${FILES}"
64
+ echo ""
65
+ echo "Try running: npm run reformat"
66
+ exit 1
67
+ fi
59
68
eslint :
60
69
runs-on : ubuntu-latest
61
70
steps :
You can’t perform that action at this time.
0 commit comments