Skip to content

Commit f0be710

Browse files
committed
Enhanced License Check
- As we are getting blacklisted from data websites, we have to limit the usage - Now the check can be executed manually using /check-license comment - It will be still manually executed daily on main branch - It can be executed also from the Actions menu - Removed staging profile - Switched to Temurin JDK Signed-off-by: David Matějček <david.matejcek@omnifish.ee>
1 parent cd13f04 commit f0be710

1 file changed

Lines changed: 31 additions & 7 deletions

File tree

.github/workflows/maven.yml

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2022, 2024 Contributors to the Eclipse Foundation
2+
# Copyright (c) 2022, 2026 Contributors to the Eclipse Foundation
33
#
44
# This program and the accompanying materials are made available under the
55
# terms of the Eclipse Public License v. 2.0 which is available at
@@ -10,12 +10,23 @@
1010
# SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
1111
#
1212

13-
name: Eclipse Required License Check
13+
name: License Check
1414

15-
on: [push, pull_request]
15+
on:
16+
workflow_dispatch:
17+
schedule:
18+
- cron: "0 5 * * *"
19+
issue_comment:
20+
types: [created]
1621

1722
jobs:
1823
build:
24+
if: >
25+
github.event_name != 'issue_comment' ||
26+
(github.event.issue.pull_request &&
27+
contains(github.event.comment.body, '/check-license') ||
28+
contains(github.event.comment.body, '/license-check')
29+
)
1930
name: Build on JDK ${{ matrix.java_version }} with ${{matrix.test_profiles}} profile
2031
runs-on: ubuntu-latest
2132
env:
@@ -24,25 +35,38 @@ jobs:
2435
strategy:
2536
matrix:
2637
java_version: [ 21 ]
27-
verify_profiles: [ '-Plicense_check,staging' ]
28-
continue-on-error: false
38+
verify_profiles: [ '-Plicense_check' ]
2939

3040
steps:
41+
- name: Get PR ref
42+
if: github.event_name == 'issue_comment'
43+
id: pr
44+
uses: actions/github-script@v7
45+
with:
46+
script: |
47+
const pr = await github.rest.pulls.get({
48+
owner: context.repo.owner,
49+
repo: context.repo.repo,
50+
pull_number: context.issue.number
51+
});
52+
core.setOutput('ref', pr.data.head.sha);
3153
- name: Checkout for build
3254
uses: actions/checkout@v4
3355
with:
3456
fetch-depth: 0
57+
ref: ${{ steps.pr.outputs.ref || github.ref }}
3558
- name: Set up JDK
3659
uses: actions/setup-java@v4.1.0
3760
with:
38-
distribution: 'zulu'
61+
distribution: 'temurin'
3962
java-version: ${{ matrix.java_version }}
4063
- name: configure JDK
4164
run: |
4265
secLoc=`find $JAVA_HOME -name java.security`
4366
sed -i 's/jdk.tls.disabledAlgorithms/# jdk.tls.disabledAlgorithms/g' -i $secLoc
4467
- name: Build
45-
run: mvn -V -U -B ${{matrix.verify_profiles}} org.eclipse.dash:license-tool-plugin:license-check -DexcludeArtifactIds=bsh,jmh-core,jmh-generator-annprocess,swing-layout -pl '!:version-agnostic'
68+
run: mvn -ntp -V -U -B ${{matrix.verify_profiles}} org.eclipse.dash:license-tool-plugin:license-check -DexcludeArtifactIds=bsh,jmh-core,jmh-generator-annprocess,swing-layout -pl '!:version-agnostic'
69+
continue-on-error: true
4670
- name: Upload license-check info
4771
uses: actions/upload-artifact@v4
4872
with:

0 commit comments

Comments
 (0)