Skip to content

Commit 23efe49

Browse files
committed
chore: remove third party github action for prettier
1 parent 9f938c3 commit 23efe49

File tree

1 file changed

+19
-10
lines changed

1 file changed

+19
-10
lines changed

.github/workflows/code_health.yaml

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,25 +37,34 @@ jobs:
3737
exit 1
3838
fi
3939
prettier:
40-
name: Prettier Check
4140
runs-on: ubuntu-latest
4241
steps:
4342
- uses: GitHubSecurityLab/actions-permissions/monitor@v1
4443
with:
4544
config: ${{ vars.PERMISSIONS_CONFIG }}
4645
- name: Checkout Repository
4746
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
5148
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
5651
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
5968
eslint:
6069
runs-on: ubuntu-latest
6170
steps:

0 commit comments

Comments
 (0)