pf2e
pf2e copied to clipboard
[CI] Only run `eslint` on files that are different from the `master` branch
This significantly reduces CI time by running eslint
only on .ts
files that are different from the current master
branch of foundryvtt/pf2e
.
This is achieved by the following steps:
- Set
https://github.com/foundryvtt/pf2e.git
asupstream
remote - Fetch current
master
branch fromupstream
- Get changed files with
git diff --name-only --diff-filter=ACMRTUXB upstream/master | grep -E "^[src|build|tests|types].*\.ts$"
-
--diff-filter - Select only files that are Added (A), Copied (C), Modified (M), Renamed (R), have their type (i.e. regular file, symlink, submodule, …) changed (T), are Unmerged (U), are Unknown (X), or have had their pairing Broken (B).
-
- Run
eslint
with the list of changed files instead of all files.
Successful run: https://github.com/In3luki/pf2e/actions/runs/8849898027 Failed run: https://github.com/In3luki/pf2e/actions/runs/8849877210