From 4c66815443f229076b4f362c01e35c0323bba9da Mon Sep 17 00:00:00 2001 From: Jozef Marko Date: Wed, 4 Dec 2024 12:04:47 +0100 Subject: [PATCH 1/4] Add NOTICE Copyright year check --- .github/workflows/ci_check_license_headers.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci_check_license_headers.yaml b/.github/workflows/ci_check_license_headers.yaml index a52a7ce8c06..b0e58a9bbcf 100644 --- a/.github/workflows/ci_check_license_headers.yaml +++ b/.github/workflows/ci_check_license_headers.yaml @@ -41,3 +41,7 @@ jobs: - name: Run Apache RAT run: | java -jar apache-rat-0.16.1.jar -d . -E .rat-excludes | grep "== File:" && echo "The files listed above are missing license headers." && exit 1 || echo "All files have license headers." + + - name: Check NOTICE Copyright year + run: | + (grep "Copyright $(date +%Y) The Apache Software Foundation" NOTICE && echo "NOTICE Copyright year is up to date") || echo "NOTICE Copyright year is outdated" && exit 1 From ff9d0d979be6f2bafab6c3b464519eed46fb534b Mon Sep 17 00:00:00 2001 From: Jozef Marko Date: Wed, 4 Dec 2024 12:10:56 +0100 Subject: [PATCH 2/4] Add () --- .github/workflows/ci_check_license_headers.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci_check_license_headers.yaml b/.github/workflows/ci_check_license_headers.yaml index b0e58a9bbcf..5a1e588297c 100644 --- a/.github/workflows/ci_check_license_headers.yaml +++ b/.github/workflows/ci_check_license_headers.yaml @@ -44,4 +44,4 @@ jobs: - name: Check NOTICE Copyright year run: | - (grep "Copyright $(date +%Y) The Apache Software Foundation" NOTICE && echo "NOTICE Copyright year is up to date") || echo "NOTICE Copyright year is outdated" && exit 1 + (grep "Copyright $(date +%Y) The Apache Software Foundation" NOTICE && echo "NOTICE Copyright year is up to date") || (echo "NOTICE Copyright year is outdated" && exit 1) From b1c9a0b6b84fe153622f4c52d4528b734136c09c Mon Sep 17 00:00:00 2001 From: Jozef Marko Date: Thu, 5 Dec 2024 08:35:49 +0100 Subject: [PATCH 3/4] Update NOTICE automatically on the 1th of January --- .../workflows/ci_check_license_headers.yaml | 4 -- .../ci_check_notice_copyright_year.yaml | 46 +++++++++++++++++++ NOTICE | 2 +- 3 files changed, 47 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/ci_check_notice_copyright_year.yaml diff --git a/.github/workflows/ci_check_license_headers.yaml b/.github/workflows/ci_check_license_headers.yaml index 5a1e588297c..a52a7ce8c06 100644 --- a/.github/workflows/ci_check_license_headers.yaml +++ b/.github/workflows/ci_check_license_headers.yaml @@ -41,7 +41,3 @@ jobs: - name: Run Apache RAT run: | java -jar apache-rat-0.16.1.jar -d . -E .rat-excludes | grep "== File:" && echo "The files listed above are missing license headers." && exit 1 || echo "All files have license headers." - - - name: Check NOTICE Copyright year - run: | - (grep "Copyright $(date +%Y) The Apache Software Foundation" NOTICE && echo "NOTICE Copyright year is up to date") || (echo "NOTICE Copyright year is outdated" && exit 1) diff --git a/.github/workflows/ci_check_notice_copyright_year.yaml b/.github/workflows/ci_check_notice_copyright_year.yaml new file mode 100644 index 00000000000..108a03c92c0 --- /dev/null +++ b/.github/workflows/ci_check_notice_copyright_year.yaml @@ -0,0 +1,46 @@ +# +# 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 :: Notice Copyright year" + +on: + schedule: + - cron '* * 1 1 *' + +jobs: + keepNoticeCopyrightYearUpToDate: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Update NOTICE Copyright year + run: | + sed -i s/"Copyright 2023-$(($(date +%Y)-1)) The Apache Software Foundation"/"Copyright 2023-$(date +%Y) The Apache Software Foundation"/g NOTICE + - name: Create Pull Request + uses: peter-evans/create-pull-request@v7 + with: + add-paths: | + NOTICE + branch: | + notice-copyright-year + commit-message: | + "Update NOTICE Copyright $(date +%Y)" + + Please delete the notice-copyright-year branch once the pull request is merged diff --git a/NOTICE b/NOTICE index c4276f2d54e..1c13133b8f8 100644 --- a/NOTICE +++ b/NOTICE @@ -1,5 +1,5 @@ Apache KIE -Copyright 2024 The Apache Software Foundation +Copyright 2023-2024 The Apache Software Foundation This product includes software developed at The Apache Software Foundation (http://www.apache.org/). From 23c427b956a913c2d0f1870eac0d52dd84a031d3 Mon Sep 17 00:00:00 2001 From: Jozef Marko Date: Thu, 5 Dec 2024 10:30:57 +0100 Subject: [PATCH 4/4] cron --- .github/workflows/ci_check_notice_copyright_year.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci_check_notice_copyright_year.yaml b/.github/workflows/ci_check_notice_copyright_year.yaml index 108a03c92c0..1cbe185fe16 100644 --- a/.github/workflows/ci_check_notice_copyright_year.yaml +++ b/.github/workflows/ci_check_notice_copyright_year.yaml @@ -21,7 +21,7 @@ name: "CI :: Notice Copyright year" on: schedule: - - cron '* * 1 1 *' + - cron '0 0 1 1 *' jobs: keepNoticeCopyrightYearUpToDate: