This is an automated email from the ASF dual-hosted git repository.

tison pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/pulsar-site.git

commit b2edc8d0a3c45eedda3cb724e3019be8ed0689cf
Author: tison <[email protected]>
AuthorDate: Wed Jan 11 09:50:01 2023 +0800

    ci: speed up license header checker
    
    Signed-off-by: tison <[email protected]>
---
 .../actions/check-license-header/action.yml        | 22 +++++++-----
 .github/workflows/ci-precommit.yml                 |  4 +--
 tools/ci/licenserc.toml                            | 42 ++++++++++++++++++++++
 tools/pytools/lib/execute/__init__.py              |  1 +
 4 files changed, 59 insertions(+), 10 deletions(-)

diff --git a/tools/ci/licenserc.yml 
b/.github/actions/check-license-header/action.yml
similarity index 70%
rename from tools/ci/licenserc.yml
rename to .github/actions/check-license-header/action.yml
index 71a63bf9545..4918ba17f4e 100644
--- a/tools/ci/licenserc.yml
+++ b/.github/actions/check-license-header/action.yml
@@ -15,11 +15,17 @@
 # specific language governing permissions and limitations
 # under the License.
 
-header:
-  license:
-    spdx-id: Apache-2.0
-    copyright-owner: Apache Software Foundation
-  paths:
-    - '**/*.py'
-    - '**/*.yaml'
-    - '**/*.yml'
+name: Check license header
+description: Check license header for files of the work.
+inputs:
+  config:
+    description: The configuration file
+    required: false
+    default: licenserc.toml
+runs:
+  using: docker
+  image: docker://ghcr.io/korandoru/hawkeye-native:v1
+  args:
+    - check
+    - --config
+    - ${{ inputs.config }}
diff --git a/.github/workflows/ci-precommit.yml 
b/.github/workflows/ci-precommit.yml
index 01014940af2..c5873b911bf 100644
--- a/.github/workflows/ci-precommit.yml
+++ b/.github/workflows/ci-precommit.yml
@@ -27,9 +27,9 @@ jobs:
     timeout-minutes: 10
     steps:
       - uses: actions/checkout@v3
-      - uses: apache/skywalking-eyes/header@main
+      - uses: ./.github/actions/check-license-header
         with:
-          config: tools/ci/licenserc.yml
+          config: tools/ci/licenserc.toml
 
   # TODO: If it causes too much time to every PR, split to another
   # workflow file and filter by paths:
diff --git a/tools/ci/licenserc.toml b/tools/ci/licenserc.toml
new file mode 100644
index 00000000000..b350a18c94a
--- /dev/null
+++ b/tools/ci/licenserc.toml
@@ -0,0 +1,42 @@
+# 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.
+
+inlineHeader = """
+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.
+"""
+
+includes = [
+    '**/*.py',
+    '**/*.toml',
+    '**/*.yaml',
+    '**/*.yml',
+]
diff --git a/tools/pytools/lib/execute/__init__.py 
b/tools/pytools/lib/execute/__init__.py
index 13a83393a91..245692337bc 100644
--- a/tools/pytools/lib/execute/__init__.py
+++ b/tools/pytools/lib/execute/__init__.py
@@ -14,3 +14,4 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
+

Reply via email to