Skip to content

Commit 41bfe70

Browse files
committed
Scope pre-commit CI to modified files only
1 parent a2b4a99 commit 41bfe70

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

.github/workflows/pre-commit.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2023-2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
1+
# Copyright 2023-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
22
#
33
# Redistribution and use in source and binary forms, with or without
44
# modification, are permitted provided that the following conditions
@@ -34,5 +34,12 @@ jobs:
3434
runs-on: ubuntu-latest
3535
steps:
3636
- uses: actions/checkout@v5.0.0
37+
with:
38+
fetch-depth: 2
39+
- name: Get modified files
40+
id: modified-files
41+
run: echo "modified_files=$(git diff --name-only -r HEAD^1 HEAD | xargs)" >> $GITHUB_OUTPUT
3742
- uses: actions/setup-python@v6.0.0
3843
- uses: pre-commit/action@v3.0.1
44+
with:
45+
extra_args: --files ${{ steps.modified-files.outputs.modified_files }}

0 commit comments

Comments
 (0)