Skip to content

Commit 37ceb3e

Browse files
authored
Remove dorny/paths-filter dep (#1635)
Signed-off-by: Ludvig Liljenberg <4257730+ludfjig@users.noreply.github.com>
1 parent 5d2319c commit 37ceb3e

1 file changed

Lines changed: 10 additions & 13 deletions

File tree

.github/workflows/ValidatePullRequest.yml

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ name: Validate Pull Request
55
on:
66
pull_request:
77
branches: [main, "release/**"]
8-
merge_group:
98

109
# Cancels old running job if a new one is triggered (e.g. by a push onto the same branch).
1110
# This will cancel dependent jobs as well, such as dep_rust and dep_fuzzing
@@ -23,22 +22,20 @@ jobs:
2322
outputs:
2423
docs-only: ${{ steps.docs-only.outputs.result }}
2524
steps:
26-
- uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1
27-
id: changes
28-
with:
29-
filters: |
30-
docs:
31-
- '**/*.md'
32-
- '**/*.txt'
33-
all:
34-
- '**/*'
25+
# Determine whether a PR only touches docs (*.md / *.txt) so downstream
26+
# jobs can skip expensive work.
3527
- uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
3628
id: docs-only
3729
with:
3830
script: |
39-
let docs_file_count = ${{steps.changes.outputs.docs_count}};
40-
let all_file_count = ${{steps.changes.outputs.all_count}};
41-
return all_file_count === docs_file_count;
31+
const files = await github.paginate(github.rest.pulls.listFiles, {
32+
owner: context.repo.owner,
33+
repo: context.repo.repo,
34+
pull_number: context.payload.pull_request.number,
35+
per_page: 100,
36+
});
37+
const isDoc = f => /\.(md|txt)$/.test(f.filename);
38+
return files.length > 0 && files.every(isDoc);
4239
result-encoding: string
4340

4441
# Update guest Cargo.lock for Dependabot PRs.

0 commit comments

Comments
 (0)