From 2671105071cd366cb86015f0154a3e05cd87f545 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=98=BFCai?= Date: Tue, 22 Oct 2024 15:30:38 +0800 Subject: [PATCH 1/3] ci: some ci only after certain file directories are changed --- .github/workflows/pr-merge-dev-npm_preview.yml | 6 ++++++ .github/workflows/pr-merge.yml | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/.github/workflows/pr-merge-dev-npm_preview.yml b/.github/workflows/pr-merge-dev-npm_preview.yml index 7d6445305..5944c76af 100644 --- a/.github/workflows/pr-merge-dev-npm_preview.yml +++ b/.github/workflows/pr-merge-dev-npm_preview.yml @@ -14,6 +14,12 @@ on: pull_request_target: types: - closed + paths: # 这里是用来指定哪个文件更改,才会触发的 + - 'src/**/*.js' + - 'src/**/*.scss' + - 'package.json' + - 'types/**' + - 'build/*.js' permissions: pull-requests: write diff --git a/.github/workflows/pr-merge.yml b/.github/workflows/pr-merge.yml index bd6bd8828..bacd23258 100644 --- a/.github/workflows/pr-merge.yml +++ b/.github/workflows/pr-merge.yml @@ -4,6 +4,12 @@ on: pull_request_target: types: - closed + paths: # 这里是用来指定哪个文件更改,才会触发的 + - 'src/**/*.js' + - 'src/**/*.scss' + - 'package.json' + - 'types/**' + - 'build/*.js' jobs: remove_assets: From 3956632c70d10d341cd083c9bc57d8141dcc5cf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=98=BFCai?= Date: Tue, 22 Oct 2024 19:42:30 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=99=90=E5=88=B6?= =?UTF-8?q?=E7=9B=AE=E5=BD=95=E5=8C=B9=E9=85=8D=E8=A7=84=E5=88=99=20?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B5=8B=E8=AF=95=E8=84=9A=E6=9C=ACaction?= =?UTF-8?q?=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 5 +++++ .github/workflows/pr-merge-dev-npm_preview.yml | 5 ++--- .github/workflows/pr-merge.yml | 5 ++--- .github/workflows/pr-test.yml | 5 +++++ 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5030c607a..f25439061 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,6 +8,11 @@ on: branches: [main, dev] pull_request: branches: [main, dev] + paths: # 这里是用来指定哪个文件更改,才会触发的 + - 'src/**' + - 'package.json' + - 'types/**' + - 'examples/**' jobs: build: diff --git a/.github/workflows/pr-merge-dev-npm_preview.yml b/.github/workflows/pr-merge-dev-npm_preview.yml index 5944c76af..d2593cbc1 100644 --- a/.github/workflows/pr-merge-dev-npm_preview.yml +++ b/.github/workflows/pr-merge-dev-npm_preview.yml @@ -15,11 +15,10 @@ on: types: - closed paths: # 这里是用来指定哪个文件更改,才会触发的 - - 'src/**/*.js' - - 'src/**/*.scss' + - 'src/**' - 'package.json' - 'types/**' - - 'build/*.js' + - 'examples/**' permissions: pull-requests: write diff --git a/.github/workflows/pr-merge.yml b/.github/workflows/pr-merge.yml index bacd23258..d19bb5b43 100644 --- a/.github/workflows/pr-merge.yml +++ b/.github/workflows/pr-merge.yml @@ -5,11 +5,10 @@ on: types: - closed paths: # 这里是用来指定哪个文件更改,才会触发的 - - 'src/**/*.js' - - 'src/**/*.scss' + - 'src/**' - 'package.json' - 'types/**' - - 'build/*.js' + - 'examples/**' jobs: remove_assets: diff --git a/.github/workflows/pr-test.yml b/.github/workflows/pr-test.yml index e3a4e35d8..3eb9c2bc1 100644 --- a/.github/workflows/pr-test.yml +++ b/.github/workflows/pr-test.yml @@ -3,6 +3,11 @@ name: PR Test on: pull_request_target: branches: [main, dev] + paths: # 这里是用来指定哪个文件更改,才会触发的 + - 'src/**' + - 'package.json' + - 'types/**' + - 'examples/**' jobs: build: From e4c4c49fff801657c35ba2078eb2c3ea151f73d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=98=BFCai?= Date: Tue, 22 Oct 2024 19:52:04 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=B5=8B=E8=AF=95action=20=E8=BF=87?= =?UTF-8?q?=E6=BB=A4=E7=9B=AE=E5=BD=95=E6=B7=BB=E5=8A=A0test=E7=9B=AE?= =?UTF-8?q?=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/pr-test.yml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/pr-test.yml b/.github/workflows/pr-test.yml index 3eb9c2bc1..d17d959f5 100644 --- a/.github/workflows/pr-test.yml +++ b/.github/workflows/pr-test.yml @@ -3,11 +3,12 @@ name: PR Test on: pull_request_target: branches: [main, dev] - paths: # 这里是用来指定哪个文件更改,才会触发的 - - 'src/**' - - 'package.json' - - 'types/**' - - 'examples/**' + paths: # 这里是用来指定哪个文件更改,才会触发的 + - "src/**" + - "package.json" + - "types/**" + - "examples/**" + - "test/**" jobs: build: @@ -21,7 +22,7 @@ jobs: steps: - uses: actions/checkout@v2 with: - ref: '${{ env.HEAD_SHA }}' + ref: "${{ env.HEAD_SHA }}" - name: Get changed files and operations run: | @@ -44,7 +45,7 @@ jobs: if: ${{ env.GIT_DIFF_FILES }} with: repository: ${{ github.repository }} - ref: '${{ env.BASE_SHA }}' + ref: "${{ env.BASE_SHA }}" path: base-repo - name: Replace changed files @@ -59,7 +60,7 @@ jobs: uses: actions/setup-node@v2 with: node-version: 16.x - cache: 'yarn' + cache: "yarn" - name: Install dependencies uses: borales/actions-yarn@v3.0.0