Skip to content

Commit 4df0f00

Browse files
authored
chore: improve GH workflows (#533)
1 parent da4e6f6 commit 4df0f00

File tree

3 files changed

+42
-2
lines changed

3 files changed

+42
-2
lines changed

.github/workflows/linter.yml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: PR Prettier Check
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- opened
7+
- edited
8+
- synchronize
9+
- ready_for_review
10+
11+
permissions:
12+
pull-requests: read
13+
14+
jobs:
15+
########### LINT PACKAGE ############
16+
lint-package:
17+
name: Lint Package
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v3
22+
23+
- uses: pnpm/[email protected]
24+
25+
- name: Setup Node
26+
uses: actions/setup-node@v3
27+
with:
28+
node-version: 20.10.0
29+
cache: 'pnpm'
30+
registry-url: https://registry.npmjs.org/
31+
32+
- run: corepack enable
33+
34+
- name: Install NPM Dependencies
35+
run: pnpm install --frozen-lockfile
36+
37+
- name: Prettier Check
38+
if: ${{ always() }}
39+
run: pnpm fmt.check

.github/workflows/pr.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: PR Title Checks
1+
name: PR Title Check
22

33
on:
44
pull_request_target:

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@
8282
"test.unit": "uvu -r tsm tests/unit",
8383
"tsc.watch": "tsc -w",
8484
"version": "npm run build.prod",
85-
"fmt": "prettier --config package.json --write src"
85+
"fmt": "prettier --config package.json --write src",
86+
"fmt.check": "prettier --config package.json --check src"
8687
},
8788
"devDependencies": {
8889
"@microsoft/api-extractor": "^7.19.5",

0 commit comments

Comments
 (0)