-
Notifications
You must be signed in to change notification settings - Fork 1.2k
39 lines (32 loc) · 1008 Bytes
/
check-format.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
name: Files
on:
merge_group:
pull_request:
jobs:
check-filenames:
name: FILENAME check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npm run check:filenames
check-formatting:
name: FILE FORMAT
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Create NPM cache-hash input file
run: |
mkdir -p tmp
jq '{devDependencies, engines, gitHubActionCacheKey}' package.json > tmp/package-ci.json
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: npm
cache-dependency-path: tmp/package-ci.json
- name: Install package(s)
run: |
PRETTIER_AT_VERS=@$(npm pkg get devDependencies.prettier | tr -d '^"')
echo "PRETTIER_AT_VERS=$PRETTIER_AT_VERS" | tee -a $GITHUB_ENV
npm install prettier$PRETTIER_AT_VERS --no-save
set -x && npx prettier --version
- run: npm run check:format