gnodet commented on code in PR #27559:
URL: https://github.com/apache/camel/pull/27559#discussion_r4248906283


##########
.github/workflows/pr-license-check.yml:
##########
@@ -0,0 +1,65 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+# Runs the Mycila license-maven-plugin check on every PR.
+#
+# This workflow is intentionally separate from pr-build-main.yml, which has
+# paths-ignore entries for Jenkinsfile and Jenkinsfile.* (CI-only changes do
+# not need a full build). That exclusion means PRs that only add a new
+# Jenkinsfile variant bypass the license check entirely, and the file may land
+# without a license header mapping in pom.xml (failIfUnknown=true would not
+# have caught Jenkinsfile.jdk26 and Jenkinsfile.jdk27 in time).
+#
+# This workflow has NO paths-ignore so it always runs, keeping the license
+# header mapping up-to-date for every file type added to the repository.
+
+name: PR license check
+
+on:
+  pull_request:
+    branches:
+      - main
+
+concurrency:
+  group: ${{ github.workflow }}-${{ github.event.pull_request.number || 
github.ref }}
+  cancel-in-progress: true
+
+permissions:
+  contents: read
+
+jobs:
+  license-check:
+    if: github.repository == 'apache/camel'
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # 
v7.0.1
+        with:
+          persist-credentials: false
+      - name: Set up JDK 21
+        uses: actions/setup-java@de7274f081f381c8f8158605e0321c36c376e2e6 # 
v6.0.1
+        with:
+          distribution: 'temurin'
+          java-version: '21'
+          cache: 'maven'
+      - name: Check license headers
+        # -N: non-recursive — only checks files at the root project level, 
which

Review Comment:
   The `-N` flag tells Maven not to recurse into sub-modules. With 
`aggregate=false` (the license plugin's default), the root project additionally 
excludes its 16 declared module directories from the scan. So the plugin checks 
root-level files — `Jenkinsfile`, `Jenkinsfile.*`, and other root-level 
additions — which is exactly the gap we're closing.
   
   Sub-module Java sources carry standard ASF headers and are already verified 
by the main PR build. The paths-ignored files in `pr-build-main.yml` 
(`Jenkinsfile`, `Jenkinsfile.*`) are the only entries the plugin would actually 
inspect here, because the root `licenseSet` already excludes `.github/**/*`, 
`**/*.md`, `**/*.adoc`, `**/*.txt`, etc. This is what makes the workflow 
lightweight enough to run on every PR.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to