Skip to content

Commit f9088ff

Browse files
authored
ci: Add centralized add-license pre-commit hook (#447)
1 parent 4583808 commit f9088ff

3 files changed

Lines changed: 15 additions & 3 deletions

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 }}

.pre-commit-config.yaml

Lines changed: 6 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
@@ -71,3 +71,8 @@ repos:
7171
- id: mixed-line-ending
7272
- id: requirements-txt-fixer
7373
- id: trailing-whitespace
74+
75+
- repo: https://github.com/triton-inference-server/developer_tools
76+
rev: v0.1.0
77+
hooks:
78+
- id: add-license

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
1+
Copyright (c) 2020-2026, NVIDIA CORPORATION. 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

0 commit comments

Comments
 (0)