Optionaloptions: Readonly<{ baseBranch?: string; pathsIgnore?: readonly string[] }>Configuration options
Array of patterns to ignore when determining if type checks should run. Supports three pattern types:
.cspell.config.yaml matches only that filedocs/ matches any file in docs directory**.md matches any markdown file Defaults to:
['LICENSE', '.editorconfig', '.gitignore', '.cspell.json', '.cspell.config.yaml', '.markdownlint-cli2.mjs', '.npmignore', '.prettierignore', '.prettierrc', 'docs/', '**.md', '**.txt']Base branch to compare against for determining
changed files. Defaults to 'origin/main'
A promise that resolves when the check is complete. The function
will set the GITHUB_OUTPUT environment variable with should_run=true or
should_run=false if running in GitHub Actions environment.
// Use default settings (compare against origin/main, ignore docs/md/txt files)
await checkShouldRunTypeChecks();
// Custom ignore patterns
await checkShouldRunTypeChecks({
pathsIgnore: ['.eslintrc.json', 'docs/', '**.md', 'scripts/'],
});
// Custom base branch
await checkShouldRunTypeChecks({
baseBranch: 'origin/develop',
});
Checks if TypeScript type checks should run based on the diff from a base branch. Skips type checks if all changed files match the ignored patterns.
This function is typically used in CI/CD pipelines to determine whether expensive type checking operations should be performed. If all changed files are documentation, configuration, or other non-TypeScript files, type checks can be safely skipped to improve build performance.