File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,8 @@ name: Prettier Autofix
33on :
44 push :
55 branches : ["**"]
6+ pull_request :
7+ branches : ["main"]
68
79permissions :
810 contents : write
2426
2527 - name : Run Prettier
2628 run : npx prettier --write "kubejs/**/*.{js,json}"
29+ continue-on-error : false
2730
2831 - name : Commit changes
32+ if : github.event_name == 'push'
2933 uses : stefanzweifel/git-auto-commit-action@v5
3034 with :
31- commit_message : " chore: format with Prettier"
35+ commit_message : " chore: prettier formatting"
36+
37+ - name : Check for formatting changes
38+ if : github.event_name == 'pull_request'
39+ run : |
40+ if ! git diff --exit-code; then
41+ echo "::notice::Some files are not properly formatted. You may want to run prettier locally. This will also get auto fixed on commit."
42+ else
43+ echo "::notice::All files are properly formatted."
44+ fi
You can’t perform that action at this time.
0 commit comments