Skip to content

Commit

Permalink
Refactor license check
Browse files Browse the repository at this point in the history
  • Loading branch information
PHILO-HE committed Jun 3, 2024
1 parent fec9be2 commit 5e2459d
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 12 deletions.
File renamed without changes.
2 changes: 1 addition & 1 deletion dev/check.sh → .github/workflows/check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# limitations under the License.

export BASE_COMMIT=$1
dev/check.py header branch
check.py header branch
if [ $? -ne 0 ]; then
dev/check.py header branch --fix
echo -e "\n==== Apply using:"
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/check_license.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# 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.

name: license header check

on:
pull_request

concurrency:
group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }}
cancel-in-progress: true

jobs:
license-check:
name: License Header Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Check License Header
run: |
git fetch --recurse-submodules=no origin main ${{github.event.pull_request.base.sha}}
pip install regex
cd $GITHUB_WORKSPACE/.github/workflows/
check.sh ${{github.event.pull_request.base.sha}}
12 changes: 1 addition & 11 deletions .github/workflows/code_style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,4 @@ jobs:
git diff -- '*CMakeLists.txt' '*.cmake'
exit 1
fi
license-check:
name: License Header Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Check License Header
run: |
git fetch --recurse-submodules=no origin main ${{github.event.pull_request.base.sha}}
pip install regex
dev/check.sh ${{github.event.pull_request.base.sha}}
echo "No CMake format issue."

0 comments on commit 5e2459d

Please sign in to comment.