1
0
mirror of https://github.com/Stirling-Tools/Stirling-PDF.git synced 2024-11-18 05:10:12 +01:00
Stirling-PDF/.github/workflows/licenses-update.yml

49 lines
1.2 KiB
YAML
Raw Normal View History

2024-01-04 20:17:38 +01:00
name: License Report Workflow
on:
push:
branches:
- main
paths:
- 'build.gradle'
permissions:
contents: write
pull-requests: write
jobs:
generate-license-report:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'adopt'
- name: Run Gradle Command
run: ./gradlew clean generateLicenseReport
- name: Move and Rename License File
run: |
mv build/reports/dependency-license/index.json src/main/resources/static/3rdPartyLicenses.json
2024-01-04 21:59:52 +01:00
- name: Check for Changes
id: git-check
run: |
git add src/main/resources/static/3rdPartyLicenses.json
git diff --staged --exit-code || echo "changes=true" >> $GITHUB_ENV
2024-01-04 20:17:38 +01:00
- name: Commit and Push Changes
2024-01-04 21:59:52 +01:00
if: env.changes == 'true'
2024-01-04 20:17:38 +01:00
run: |
git config --global user.name 'Stirling-PDF-Bot'
git config --global user.email 'Stirling-PDF-Bot@stirlingtools.com'
git commit -m "Update 3rd Party Licenses"
git push
2024-01-04 21:59:52 +01:00