pf2e icon indicating copy to clipboard operation
pf2e copied to clipboard

[CI] Only run `eslint` on files that are different from the `master` branch

Open In3luki opened this issue 10 months ago • 0 comments

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 as upstream remote
  • Fetch current master branch from upstream
  • 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

In3luki avatar Apr 26 '24 14:04 In3luki