Skip to content

Commit 2a6bdb2

Browse files
authored
add license header check v2 (#38)
fix #37 Add v2 for new branch strategy. Allow to check main branch test run: https://github.com/YanxuanLiu/spark-rapids/actions/runs/15484134743/job/43595238006?pr=31 --------- Signed-off-by: Yanxuan Liu <[email protected]>
1 parent 983db96 commit 2a6bdb2

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

.github/workflows/license-header-check.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ jobs:
3636
- name: license-header-check
3737
uses: NVIDIA/spark-rapids-common/license-header-check@main
3838
with:
39+
check_main: true
3940
included_file_patterns: |
4041
*.yml,
4142
*Dockerfile*,

license-header-check/action.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ inputs:
2323
description: "excluded file pattern"
2424
required: false
2525
type: string
26+
check_main:
27+
description: "check main branch or not"
28+
required: false
29+
type: boolean
30+
default: false
2631

2732
runs:
2833
using: "composite"
@@ -36,8 +41,8 @@ runs:
3641
CURRENT_YEAR=$(date +%Y)
3742
LICENSE_PATTERN="Copyright \(c\) .*?${CURRENT_YEAR},? NVIDIA CORPORATION."
3843
39-
# Skip for merge to main PR
40-
if [[ "${{ github.event.pull_request.base.ref }}" == "main" ]]; then
44+
# Skip check for main branch when check_main == false
45+
if [[ "${{ inputs.check_main }}" == "false" && "${{ github.event.pull_request.base.ref }}" == "main" ]]; then
4146
echo "Skip this check for Merge to main PR."
4247
exit 0
4348
fi

0 commit comments

Comments
 (0)