Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 16 additions & 6 deletions .github/workflows/check-notice.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,39 @@ name: Check NOTICE.txt

on:
pull_request:
paths:
- 'build.gradle.kts'
- 'NOTICE.template'
- 'NOTICE.txt'
- 'buildSrc/**'

jobs:
check-notice:
runs-on: ubuntu-latest
steps:
- uses: dorny/paths-filter@v3
id: changes
with:
# If any of these files changed, then we may need to update the NOTICE.txt
filters: |
notice:
- 'build.gradle.kts'
- 'NOTICE.template'
- 'NOTICE.txt'
- 'buildSrc/**'

- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
if: steps.changes.outputs.notice == 'true'

- name: Set up JDK 25
if: steps.changes.outputs.notice == 'true'
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
with:
cache: gradle
distribution: zulu
java-version: '25'
cache: gradle

- name: Generate NOTICE.txt
if: steps.changes.outputs.notice == 'true'
run: ./gradlew generateLicenseReport

- name: Check NOTICE.txt is up to date
if: steps.changes.outputs.notice == 'true'
run: |
if ! git diff --exit-code NOTICE.txt; then
echo "::error::NOTICE.txt is out of date. Run './gradlew generateLicenseReport' and commit the result."
Expand Down