]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
ci: add autofix for pr (#9112)
author三咲智子 Kevin Deng <sxzz@sxzz.moe>
Tue, 5 Sep 2023 07:22:39 +0000 (02:22 -0500)
committerGitHub <noreply@github.com>
Tue, 5 Sep 2023 07:22:39 +0000 (15:22 +0800)
.github/workflows/autofix.yml [new file with mode: 0644]
.github/workflows/ci.yml
.github/workflows/size-data.yml
.github/workflows/size-report.yml

diff --git a/.github/workflows/autofix.yml b/.github/workflows/autofix.yml
new file mode 100644 (file)
index 0000000..a51b76f
--- /dev/null
@@ -0,0 +1,33 @@
+name: autofix.ci
+
+on:
+  pull_request:
+permissions:
+  contents: read
+
+jobs:
+  autofix:
+    runs-on: ubuntu-latest
+    env:
+      PUPPETEER_SKIP_DOWNLOAD: 'true'
+    steps:
+      - uses: actions/checkout@v3
+
+      - name: Install pnpm
+        uses: pnpm/action-setup@v2
+
+      - name: Set node version to 18
+        uses: actions/setup-node@v3
+        with:
+          node-version: 18
+          cache: pnpm
+
+      - run: pnpm install
+
+      - name: Run eslint
+        run: pnpm run lint --fix
+
+      - name: Run prettier
+        run: pnpm run format
+
+      - uses: autofix-ci/action@8caa572fd27b0019a65e4c695447089c8d3138b9
index 8c08c9a935af66dc059e8df0de9f4445aa1c0855..b85878c836a32cb1099fb6e104e64c063d359854 100644 (file)
@@ -14,6 +14,8 @@ jobs:
   unit-test:
     runs-on: ubuntu-latest
     if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
+    env:
+      PUPPETEER_SKIP_DOWNLOAD: 'true'
     steps:
       - uses: actions/checkout@v3
 
@@ -26,9 +28,6 @@ jobs:
           node-version: 18
           cache: 'pnpm'
 
-      - name: Skip Puppeteer download
-        run: echo "PUPPETEER_SKIP_DOWNLOAD=1" >> $GITHUB_ENV
-
       - run: pnpm install
 
       - name: Run unit tests
@@ -37,6 +36,8 @@ jobs:
   unit-test-windows:
     runs-on: windows-latest
     if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
+    env:
+      PUPPETEER_SKIP_DOWNLOAD: 'true'
     steps:
       - uses: actions/checkout@v3
 
@@ -49,9 +50,6 @@ jobs:
           node-version: 18
           cache: 'pnpm'
 
-      - name: Skip Puppeteer download
-        run: echo "PUPPETEER_SKIP_DOWNLOAD=1" >> $env:GITHUB_ENV
-
       - run: pnpm install
 
       - name: Run compiler unit tests
@@ -89,6 +87,8 @@ jobs:
   lint-and-test-dts:
     runs-on: ubuntu-latest
     if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
+    env:
+      PUPPETEER_SKIP_DOWNLOAD: 'true'
     steps:
       - uses: actions/checkout@v3
 
@@ -101,9 +101,6 @@ jobs:
           node-version: 18
           cache: 'pnpm'
 
-      - name: Skip Puppeteer download
-        run: echo "PUPPETEER_SKIP_DOWNLOAD=1" >> $GITHUB_ENV
-
       - run: pnpm install
 
       - name: Run eslint
index 647e029c57825314294676da4e58115ebcf408f3..a9edfeb6e0a67291c36d44bf82d4c27c60971066 100644 (file)
@@ -11,6 +11,9 @@ on:
 permissions:
   contents: read
 
+env:
+  PUPPETEER_SKIP_DOWNLOAD: 'true'
+
 jobs:
   upload:
     runs-on: ubuntu-latest
@@ -28,7 +31,7 @@ jobs:
           cache: pnpm
 
       - name: Install dependencies
-        run: PUPPETEER_SKIP_DOWNLOAD=1 pnpm install
+        run: pnpm install
 
       - run: pnpm run size
 
index 75c52f717b38b5436f6f6267b043da8c001862e0..d0b2e2b40eeab31526cc66cbd07b2398c7c79e95 100644 (file)
@@ -11,6 +11,9 @@ permissions:
   pull-requests: write
   issues: write
 
+env:
+  PUPPETEER_SKIP_DOWNLOAD: 'true'
+
 jobs:
   size-report:
     runs-on: ubuntu-latest
@@ -30,7 +33,7 @@ jobs:
           cache: pnpm
 
       - name: Install dependencies
-        run: PUPPETEER_SKIP_DOWNLOAD=1 pnpm install
+        run: pnpm install
 
       - name: Download PR number
         uses: dawidd6/action-download-artifact@v2