Skip to content

Commit

Permalink
kie-issues#1613: Add CI :: Check license headers GitHub Actions wor…
Browse files Browse the repository at this point in the history
…kflow (apache#3130)

* Add license header

* Revert "Add license header"

This reverts commit be404f1.

* .rat-excludes

* align naming with kie-issues#1613 ensemble

* moce licenses into single file

* LICENSE.txt -> LICENSE

* Remove NOTICE

* Add jstree, jquery in .rat-excludes

* NOTICE recreated
  • Loading branch information
jomarko committed Nov 27, 2024
1 parent 6bb800f commit 139cb30
Show file tree
Hide file tree
Showing 5 changed files with 164 additions and 24 deletions.
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 @@ -32,3 +32,6 @@

# Repository wide ignore mac DS_Store files
.DS_Store

# Apache RAT check excludes file
!.rat-excludes
23 changes: 23 additions & 0 deletions .rat-excludes
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
### 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

### optaplanner specific excludes
**/optaplanner-docs/src/modules/ROOT/images/website/jquery/jquery.min.js
**/optaplanner-docs/src/modules/ROOT/images/website/jstree/**
**/optaplanner-examples/data/**/import/**
**/eclipse.importorder
**/src/main/resources/org/optaplanner/benchmark/impl/report/twitterbootstrap/css/**
**/src/main/resources/org/optaplanner/benchmark/impl/report/twitterbootstrap/img/**
**/src/main/resources/org/optaplanner/benchmark/impl/report/twitterbootstrap/js/**
**/benchmark.xsd
**/solver.xsd
94 changes: 94 additions & 0 deletions LICENSE.txt → LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -200,3 +200,97 @@
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.

------------------------------------------------------------------------------------------------------------------
for optaplanner-benchmark/src/main/resources/org/optaplanner/benchmark/impl/report/twitterbootstrap/css/bootstrap*
optaplanner-benchmark/src/main/resources/org/optaplanner/benchmark/impl/report/twitterbootstrap/img/**
optaplanner-benchmark/src/main/resources/org/optaplanner/benchmark/impl/report/twitterbootstrap/js/bootstrap*

(https://github.com/twbs/bootstrap/)
The MIT License (MIT)

Copyright (c) 2011-2019 Twitter, Inc.
Copyright (c) 2011-2019 The Bootstrap Authors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

--------------------------------------------------------------------------------------------------------------
for optaplanner-docs/src/modules/ROOT/images/website/jquery/jquery.min.js
optaplanner-benchmark/src/main/resources/org/optaplanner/benchmark/impl/report/twitterbootstrap/js/jquery*

(https://github.com/jquery/jquery)
Copyright OpenJS Foundation and other contributors, https://openjsf.org/

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

--------------------------------------------------------------------------------------------------------------------
for optaplanner-benchmark/src/main/resources/org/optaplanner/benchmark/impl/report/twitterbootstrap/css/prettify.css
optaplanner-benchmark/src/main/resources/org/optaplanner/benchmark/impl/report/twitterbootstrap/js/prettify.js

(https://github.com/googlearchive/code-prettify)
http://www.apache.org/licenses/LICENSE-2.0

-------------------------------------------------------------------------
for optaplanner-docs/src/modules/ROOT/images/website/jstree/32px.png
optaplanner-docs/src/modules/ROOT/images/website/jstree/40px.png
optaplanner-docs/src/modules/ROOT/images/website/jstree/jstree.js
optaplanner-docs/src/modules/ROOT/images/website/jstree/jstree.min.js
optaplanner-docs/src/modules/ROOT/images/website/jstree/style.css
optaplanner-docs/src/modules/ROOT/images/website/jstree/throbber.gif

(https://github.com/vakata/jstree)
Copyright (c) 2014 Ivan Bozhanov

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
26 changes: 2 additions & 24 deletions NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,5 @@ This product includes software developed at
The Apache Software Foundation (http://www.apache.org/).

The Initial Developer of some parts of the framework, which are copied from, derived from, or
inspired by KIE (Knowledge Is Everthing) group, is Red Hat, Inc (https://www.redhat.com/).
Copyright Red Hat, Inc. and/or its affiliates.. All Rights Reserved.

This product also includes the following third-party components:

* Twitter bootstrap version: 2.3.2
Downloaded from: https://getbootstrap.com/
License: Apache License v2.0 (just like OptaPlanner)

* jQuery version: 1.9.1
Downloaded from: http://jquery.com/
License: MIT (which can be used by Apache License v2.0 projects)

* google-code-pretty version: 4-Mar-2013
Downloaded from: http://code.google.com/p/google-code-prettify
License: Apache License v2.0 (just like OptaPlanner)

* jQuery version: 3.3.1
Downloaded from: http://jquery.com/
License: MIT - this is compatible with ASL 2.0: http://www.apache.org/legal/resolved.html#category-a

* jstree version: 3.3.5
Downloaded from: https://www.jstree.com/
License: MIT - this is compatible with ASL 2.0: http://www.apache.org/legal/resolved.html#category-a
inspired by KIE (Knowledge Is Everything) group, is Red Hat, Inc (https://www.redhat.com/).
Copyright Red Hat, Inc. and/or its affiliates.. All Rights Reserved.

0 comments on commit 139cb30

Please sign in to comment.