Skip to content

Commit 226fc99

Browse files
committed
Skip CI if only docs/ has changed
1 parent 7b8a986 commit 226fc99

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

.github/workflows/ci-unittests.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,23 @@ jobs:
5353
return;
5454
}
5555
56+
const changedFiles = await github.paginate(
57+
github.rest.pulls.listFiles,
58+
{
59+
owner: context.repo.owner,
60+
repo: context.repo.repo,
61+
pull_number: pr.number,
62+
per_page: 100,
63+
}
64+
);
65+
66+
const hasOnlyDocsChanges = changedFiles.length > 0 && changedFiles.every(file => file.filename.startsWith('docs/'));
67+
if (hasOnlyDocsChanges) {
68+
core.setOutput('run_ci', 'false');
69+
core.setOutput('reason', 'docs-only changes');
70+
return;
71+
}
72+
5673
if (hasWorkflowOrSuiteChanges) {
5774
core.setOutput('run_ci', 'true');
5875
core.setOutput('reason', '.github or suite.py changes');

0 commit comments

Comments
 (0)