Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/license-header-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,4 @@ jobs:
*Dockerfile*,
auto-merge/automerge,
signoff-check/signoff-check
check_main: true
15 changes: 11 additions & 4 deletions license-header-check/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ inputs:
description: "excluded file pattern"
required: false
type: string
check_main:
description: "check main branch or not"
required: false
type: boolean
default: false

runs:
using: "composite"
Expand All @@ -36,10 +41,12 @@ runs:
CURRENT_YEAR=$(date +%Y)
LICENSE_PATTERN="Copyright \(c\) .*?${CURRENT_YEAR},? NVIDIA CORPORATION."

# Skip for merge to main PR
if [[ "${{ github.event.pull_request.base.ref }}" == "main" ]]; then
echo "Skip this check for Merge to main PR."
exit 0
# Skip check for main branch when check_main == false
if [[ "${{ inputs.check_main }}" == "false" ]]; then
if [[ "${{ github.event.pull_request.base.ref }}" == "main" ]]; then
echo "Skip this check for Merge to main PR."
exit 0
fi
Copy link

Copilot AI Jun 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The nested if blocks around check_main can be simplified into a single conditional to improve readability, for example: if [[ "${{ inputs.check_main }}" == "false" && "${{ github.event.pull_request.base.ref }}" == "main" ]]; then ... fi.

Suggested change
if [[ "${{ inputs.check_main }}" == "false" ]]; then
if [[ "${{ github.event.pull_request.base.ref }}" == "main" ]]; then
echo "Skip this check for Merge to main PR."
exit 0
fi
if [[ "${{ inputs.check_main }}" == "false" && "${{ github.event.pull_request.base.ref }}" == "main" ]]; then
echo "Skip this check for Merge to main PR."
exit 0
fi

Copilot uses AI. Check for mistakes.
fi

# Format file patterns
Expand Down
Loading