Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kie-issues#1613: Add CI :: License headers / check GitHub Actions workflow #2111

Merged
merged 15 commits into from
Nov 30, 2024
Merged
42 changes: 42 additions & 0 deletions .github/workflows/ci_check_license_headers.yaml
Original file line number Diff line number Diff line change
@@ -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.
#

name: "CI :: Check license headers"

on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]

jobs:
check-license-headers:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Download Apache RAT
run: |
curl -LO https://repository.apache.org/content/repositories/snapshots/org/apache/rat/apache-rat/0.17-SNAPSHOT/apache-rat-0.17-20241115.065104-374.jar

- name: Run Apache RAT
run: |
java -jar apache-rat-0.17-20241115.065104-374.jar --input-exclude-file .rat-excludes -- . > .tmp-rat-check-output
cat .tmp-rat-check-output
grep "Files with unapproved licenses:" .tmp-rat-check-output && rm .tmp-rat-check-output && echo "There are files with missing or unapproved license headers." && exit 1 || rm .tmp-rat-check-output && echo "All files have correct license headers."
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,6 @@ package-lock.json
/cypress*

.factorypath

# Apache RAT check excludes file
!.rat-excludes
16 changes: 16 additions & 0 deletions .rat-excludes
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
### general excludes
**/target/**
**/.*
*README*
*readme*
DISCLAIMER-WIP
**/src/test/resources/**
**/src/test/filtered-resources/**
**/*integration-test*/src/main/resources/**
**/**example**/**/resources/**
**/META-INF/services/**
**/META-INF/beans.xml

### kogito-apps specific excludes
**/*.graphqls
**/kogito-addons-data-audit-jpa-common/src/main/resources/META-INF/data-audit-orm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -663,4 +663,4 @@
<!-- hint name="org.hibernate.timeout" value="200"/ -->
</named-native-query>

</entity-mappings>
Copy link
Member

Choose a reason for hiding this comment

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

maybe revert this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

</entity-mappings>
Loading