Skip to content

Commit 8adb2ca

Browse files
authored
ci: add autofix for pr (#9112)
1 parent 8f311c6 commit 8adb2ca

File tree

4 files changed

+47
-11
lines changed

4 files changed

+47
-11
lines changed

.github/workflows/autofix.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: autofix.ci
2+
3+
on:
4+
pull_request:
5+
permissions:
6+
contents: read
7+
8+
jobs:
9+
autofix:
10+
runs-on: ubuntu-latest
11+
env:
12+
PUPPETEER_SKIP_DOWNLOAD: 'true'
13+
steps:
14+
- uses: actions/checkout@v3
15+
16+
- name: Install pnpm
17+
uses: pnpm/action-setup@v2
18+
19+
- name: Set node version to 18
20+
uses: actions/setup-node@v3
21+
with:
22+
node-version: 18
23+
cache: pnpm
24+
25+
- run: pnpm install
26+
27+
- name: Run eslint
28+
run: pnpm run lint --fix
29+
30+
- name: Run prettier
31+
run: pnpm run format
32+
33+
- uses: autofix-ci/action@8caa572fd27b0019a65e4c695447089c8d3138b9

.github/workflows/ci.yml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ jobs:
1414
unit-test:
1515
runs-on: ubuntu-latest
1616
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
17+
env:
18+
PUPPETEER_SKIP_DOWNLOAD: 'true'
1719
steps:
1820
- uses: actions/checkout@v3
1921

@@ -26,9 +28,6 @@ jobs:
2628
node-version: 18
2729
cache: 'pnpm'
2830

29-
- name: Skip Puppeteer download
30-
run: echo "PUPPETEER_SKIP_DOWNLOAD=1" >> $GITHUB_ENV
31-
3231
- run: pnpm install
3332

3433
- name: Run unit tests
@@ -37,6 +36,8 @@ jobs:
3736
unit-test-windows:
3837
runs-on: windows-latest
3938
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
39+
env:
40+
PUPPETEER_SKIP_DOWNLOAD: 'true'
4041
steps:
4142
- uses: actions/checkout@v3
4243

@@ -49,9 +50,6 @@ jobs:
4950
node-version: 18
5051
cache: 'pnpm'
5152

52-
- name: Skip Puppeteer download
53-
run: echo "PUPPETEER_SKIP_DOWNLOAD=1" >> $env:GITHUB_ENV
54-
5553
- run: pnpm install
5654

5755
- name: Run compiler unit tests
@@ -89,6 +87,8 @@ jobs:
8987
lint-and-test-dts:
9088
runs-on: ubuntu-latest
9189
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
90+
env:
91+
PUPPETEER_SKIP_DOWNLOAD: 'true'
9292
steps:
9393
- uses: actions/checkout@v3
9494

@@ -101,9 +101,6 @@ jobs:
101101
node-version: 18
102102
cache: 'pnpm'
103103

104-
- name: Skip Puppeteer download
105-
run: echo "PUPPETEER_SKIP_DOWNLOAD=1" >> $GITHUB_ENV
106-
107104
- run: pnpm install
108105

109106
- name: Run eslint

.github/workflows/size-data.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ on:
1111
permissions:
1212
contents: read
1313

14+
env:
15+
PUPPETEER_SKIP_DOWNLOAD: 'true'
16+
1417
jobs:
1518
upload:
1619
runs-on: ubuntu-latest
@@ -28,7 +31,7 @@ jobs:
2831
cache: pnpm
2932

3033
- name: Install dependencies
31-
run: PUPPETEER_SKIP_DOWNLOAD=1 pnpm install
34+
run: pnpm install
3235

3336
- run: pnpm run size
3437

.github/workflows/size-report.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ permissions:
1111
pull-requests: write
1212
issues: write
1313

14+
env:
15+
PUPPETEER_SKIP_DOWNLOAD: 'true'
16+
1417
jobs:
1518
size-report:
1619
runs-on: ubuntu-latest
@@ -30,7 +33,7 @@ jobs:
3033
cache: pnpm
3134

3235
- name: Install dependencies
33-
run: PUPPETEER_SKIP_DOWNLOAD=1 pnpm install
36+
run: pnpm install
3437

3538
- name: Download PR number
3639
uses: dawidd6/action-download-artifact@v2

0 commit comments

Comments
 (0)