Skip to content

Commit

Permalink
ci: some ci only after certain file directories are changed (#951)
Browse files Browse the repository at this point in the history
* ci: some ci only after certain file directories are changed

* 修改限制目录匹配规则
添加测试脚本action限制

* 测试action 过滤目录添加test目录
  • Loading branch information
RSS1102 authored Oct 23, 2024
1 parent 4d31b05 commit 58d5725
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ on:
branches: [main, dev]
pull_request:
branches: [main, dev]
paths: # 这里是用来指定哪个文件更改,才会触发的
- 'src/**'
- 'package.json'
- 'types/**'
- 'examples/**'

jobs:
build:
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/pr-merge-dev-npm_preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ on:
pull_request_target:
types:
- closed
paths: # 这里是用来指定哪个文件更改,才会触发的
- 'src/**'
- 'package.json'
- 'types/**'
- 'examples/**'

permissions:
pull-requests: write
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/pr-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ on:
pull_request_target:
types:
- closed
paths: # 这里是用来指定哪个文件更改,才会触发的
- 'src/**'
- 'package.json'
- 'types/**'
- 'examples/**'

jobs:
remove_assets:
Expand Down
12 changes: 9 additions & 3 deletions .github/workflows/pr-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ name: PR Test
on:
pull_request_target:
branches: [main, dev]
paths: # 这里是用来指定哪个文件更改,才会触发的
- "src/**"
- "package.json"
- "types/**"
- "examples/**"
- "test/**"

jobs:
build:
Expand All @@ -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: |
Expand All @@ -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
Expand All @@ -54,7 +60,7 @@ jobs:
uses: actions/setup-node@v2
with:
node-version: 16.x
cache: 'yarn'
cache: "yarn"

- name: Install dependencies
uses: borales/[email protected]
Expand Down

0 comments on commit 58d5725

Please sign in to comment.