Create reusable change detection GitHub Action for CI optimization
Description
Currently, workflows such as run-examples.yml and pytest-and-codecov.yml run for every pull request, including documentation-only changes.
To improve CI efficiency and workflow readability, create a reusable local GitHub Action responsible for detecting changed file types and exposing outputs that workflows can consume.
Instead of implementing custom shell scripts and GitHub API calls manually, the action should internally use an existing and well-maintained solution such as tj-actions/changed-files or dorny/paths-filter.
Proposed changes
Create a local composite action, for example:
.github/actions/changed-files-check/
The action should:
Internally, prefer using an existing action for changed file detection instead of maintaining custom shell-based logic.
Then update the following workflows to skip unnecessary jobs when the PR only changes documentation files:
.github/workflows/run-examples.yml
.github/workflows/pytest-and-codecov.yml
Goal
- Reduce unnecessary CI executions for documentation-only changes
- Improve workflow readability
- Centralize change detection logic in a reusable action
- Avoid maintaining custom shell-based file detection logic
Create reusable change detection GitHub Action for CI optimization
Description
Currently, workflows such as
run-examples.ymlandpytest-and-codecov.ymlrun for every pull request, including documentation-only changes.To improve CI efficiency and workflow readability, create a reusable local GitHub Action responsible for detecting changed file types and exposing outputs that workflows can consume.
Instead of implementing custom shell scripts and GitHub API calls manually, the action should internally use an existing and well-maintained solution such as
tj-actions/changed-filesordorny/paths-filter.Proposed changes
Create a local composite action, for example:
The action should:
Detect changed files in pull requests
Determine whether the PR only changes documentation-related files
Expose outputs such as:
docs_onlyInternally, prefer using an existing action for changed file detection instead of maintaining custom shell-based logic.
Then update the following workflows to skip unnecessary jobs when the PR only changes documentation files:
.github/workflows/run-examples.yml.github/workflows/pytest-and-codecov.ymlGoal