File tree Expand file tree Collapse file tree 3 files changed +19
-12
lines changed Expand file tree Collapse file tree 3 files changed +19
-12
lines changed Original file line number Diff line number Diff line change 1
- # Copyright 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
1
+ # Copyright 2023-2024 , NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2
2
#
3
3
# Redistribution and use in source and binary forms, with or without
4
4
# modification, are permitted provided that the following conditions
34
34
runs-on : ubuntu-22.04
35
35
steps :
36
36
- uses : actions/checkout@v3
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
37
42
- uses : actions/setup-python@v3
38
43
- uses : pre-commit/action@v3.0.0
39
-
44
+ with :
45
+ extra_args : --files ${{ steps.modified-files.outputs.modified_files }}
Original file line number Diff line number Diff line change @@ -73,13 +73,12 @@ repos:
73
73
- id : requirements-txt-fixer
74
74
- id : trailing-whitespace
75
75
76
- # FIXME: Only run on changed files when triggered by GitHub Actions
77
- # - repo: local
78
- # hooks:
79
- # - id: add-license
80
- # name: Add License
81
- # entry: python tools/add_copyright.py
82
- # language: python
83
- # stages: [pre-commit]
84
- # verbose: true
85
- # require_serial: true
76
+ - repo : local
77
+ hooks :
78
+ - id : add-license
79
+ name : Add License
80
+ entry : python tools/add_copyright.py
81
+ language : python
82
+ stages : [pre-commit]
83
+ verbose : true
84
+ require_serial : true
Original file line number Diff line number Diff line change @@ -259,6 +259,8 @@ def add_copyrights(paths):
259
259
260
260
# Don't automatically 'git add' changes for now, make it more clear which
261
261
# files were changed and have ability to see 'git diff' on them.
262
+ # Note that this means the hook will modify files and then cancel the commit, which you will then
263
+ # have to manually make again.
262
264
# subprocess.run(["git", "add"] + paths)
263
265
264
266
print (f"Processed copyright headers for { len (paths )} file(s)." )
You can’t perform that action at this time.
0 commit comments