feat(ci): only run precommit on changed files#38155
feat(ci): only run precommit on changed files#38155
Conversation
Signed-off-by: hainenber <dotronghai96@gmail.com>
|
Bito Automatic Review Skipped - Files Excluded |
Sequence DiagramThe workflow change runs pre-commit hooks only against files changed in the PR by calling a local FilesChangeAction, then invokes pre-commit with that file list and fails the job if hooks modify files or report issues. This reduces unnecessary checks on unrelated files. sequenceDiagram
participant GitHub as GitHub Actions
participant Repo as Repository (checkout)
participant FilesAction as FilesChangeAction
participant PreCommit as pre-commit
participant Git as Git
GitHub->>Repo: Checkout & setup environment
GitHub->>FilesAction: Run action to list changed files
FilesAction-->>GitHub: outputs.files (changed file list)
GitHub->>PreCommit: Run pre-commit --files <changed files>
PreCommit->>Git: Modify or report issues (if any)
Git-->>GitHub: git diff status
GitHub->>GitHub: Fail job if pre-commit failed or repo dirty
Generated by CodeAnt AI |
Signed-off-by: hainenber <dotronghai96@gmail.com>
Signed-off-by: hainenber <dotronghai96@gmail.com>
Code Review Agent Run #582ddbActionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
feat(ci): only run precommit on change files
SUMMARY
Only run
precommitGit hooks for changed files in a PR.Additionally, It doesn't make sense for PR's author to fix for issues in files they didn't modify. Plus we'll save off CI resources by not running
pre-commitexcessively so.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A
TESTING INSTRUCTIONS
Green CI as acceptance of threshold.
ADDITIONAL INFORMATION