Skip to content

OPENNLP-1704: Auto-generate NOTICE for OpenNLP Core Project (#746) #1

OPENNLP-1704: Auto-generate NOTICE for OpenNLP Core Project (#746)

OPENNLP-1704: Auto-generate NOTICE for OpenNLP Core Project (#746) #1

Workflow file for this run

# 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 Main - Regenerate NOTICE
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Cache Maven packages
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-master-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-master-m2
- name: Generate Dependency Licenses
run: |
mvn license:aggregate-add-third-party@generate-and-check-licenses \
-Dlicense.skipAggregateAddThirdParty=false \
-B \
-Dlicense.thirdPartyFilename=DEPENDENCY-LICENSES \
-Dlicense.outputDirectory=target
- name: Create NOTICE File
run: |
cat src/license/NOTICE.template target/DEPENDENCY-LICENSES > NOTICE
- name: Create Pull Request after License Regeneration
uses: peter-evans/create-pull-request@v7
with:
base: main
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "Minor: Regenerated NOTICE File for ${{ github.sha }}"
committer: GitHub <noreply@github.com>
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
signoff: true
branch: regenerate_license_file_after_dep_upgrade
delete-branch: true
title: "Regenerated NOTICE file after dependency changes"
body: |
Found some uncommited changes (from NOTICE regeneration) after running build on OpenNLP
labels: |
dependency