Skip to content

Commit

Permalink
ci: add license header check
Browse files Browse the repository at this point in the history
  • Loading branch information
homksei committed Dec 13, 2024
1 parent 5a47de9 commit 50c7e59
Show file tree
Hide file tree
Showing 2 changed files with 95 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/skywalking-eyes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Copyright 2024 Intel Corporation
#
# Licensed 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.

name: Check License Header

on:
pull_request:
branches:
- main
push:
branches:
- main

permissions: read-all

concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref_name }}-${{ github.event.number || github.sha }}
cancel-in-progress: true

jobs:
check-license-header:
name: Copyright Check
runs-on: ubuntu-24.04
steps:
- name: "Checkout code"
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: "Run check"
uses: apache/skywalking-eyes/header@cd7b195c51fd3d6ad52afceb760719ddc6b3ee91 # v0.6.0
with:
mode: "check"
54 changes: 54 additions & 0 deletions .licenserc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Copyright 2024 Intel Corporation
#
# Licensed 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.

header:
license:
spdx-id: Apache-2.0
copyright-owner: Intel Corporation
pattern: |
Copyright \d{4} Intel Corporation
Licensed 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\.
paths:
- '**'

paths-ignore: # `paths-ignore` are the path list that will be ignored by license-eye.
- '.clang-format'
- '.clang-tidy'
- '.gitignore'
- '.github/scripts/setup_apt_repo_linux.sh'
- 'HISTORY.md'
- 'NEWS.md'
- 'LICENSE'
- 'THIRD-PARTY-PROGRAMS'
- 'cmake/mkl_functions'
- 'cmake/patches/tomlplusplus_v330.patch'
- 'docker/x86_64/manylinux2014/oneAPI.repo'
- 'docs/cpp/index/loader-compatibility.csv'
- 'docs/requirements.txt'

comment: never

license-location-threshold: 80 # specifies the index threshold where the license header can be located.

0 comments on commit 50c7e59

Please sign in to comment.