diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5030c607..f2543906 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 7d644530..d2593cbc 100644 --- a/.github/workflows/pr-merge-dev-npm_preview.yml +++ b/.github/workflows/pr-merge-dev-npm_preview.yml @@ -14,6 +14,11 @@ on: pull_request_target: types: - closed + paths: # 这里是用来指定哪个文件更改,才会触发的 + - 'src/**' + - 'package.json' + - 'types/**' + - 'examples/**' permissions: pull-requests: write diff --git a/.github/workflows/pr-merge.yml b/.github/workflows/pr-merge.yml index bd6bd882..d19bb5b4 100644 --- a/.github/workflows/pr-merge.yml +++ b/.github/workflows/pr-merge.yml @@ -4,6 +4,11 @@ on: pull_request_target: types: - closed + paths: # 这里是用来指定哪个文件更改,才会触发的 + - 'src/**' + - 'package.json' + - 'types/**' + - 'examples/**' jobs: remove_assets: diff --git a/.github/workflows/pr-test.yml b/.github/workflows/pr-test.yml index e3a4e35d..d17d959f 100644 --- a/.github/workflows/pr-test.yml +++ b/.github/workflows/pr-test.yml @@ -3,6 +3,12 @@ name: PR Test on: pull_request_target: branches: [main, dev] + paths: # 这里是用来指定哪个文件更改,才会触发的 + - "src/**" + - "package.json" + - "types/**" + - "examples/**" + - "test/**" jobs: build: @@ -16,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: | @@ -39,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 @@ -54,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