Skip to content

Commit 8446403

Browse files
committed
Better auto-license-report
1 parent 9ea03e9 commit 8446403

File tree

1 file changed

+12
-24
lines changed

1 file changed

+12
-24
lines changed
Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
11
name: Auto license report
22
on:
3-
pull_request:
4-
types:
5-
- opened
6-
- synchronize
3+
push:
4+
branches:
5+
- 'renovate/**/*'
76

87
concurrency:
9-
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
8+
group: ${{ github.workflow }}-${{ github.ref }}
109
cancel-in-progress: true
1110

1211
permissions:
1312
contents: read
1413

1514
jobs:
16-
check:
17-
if: ${{ github.event.pull_request.draft == false }}
15+
auto-license-report:
1816
runs-on: ubuntu-latest
1917
steps:
2018
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
@@ -33,26 +31,16 @@ jobs:
3331
with:
3432
cache-read-only: true
3533

36-
- name: Check out PR branch
37-
env:
38-
GH_TOKEN: ${{ github.token }}
39-
run: gh pr checkout ${{ github.event.pull_request.number }}
34+
- name: Use CLA approved bot
35+
run: .github/scripts/use-cla-approved-bot.sh
4036

4137
- name: Update license report
4238
run: ./gradlew generateLicenseReport --no-build-cache
4339

44-
- id: create-patch
45-
name: Create patch file
40+
- name: Commit and push if there are changes
4641
run: |
47-
git add -N --ignore-removal licenses
48-
git diff > patch
49-
if [ -s patch ]; then
50-
echo "exists=true" >> "$GITHUB_OUTPUT"
42+
git add licenses
43+
if ! git diff --cached --quiet; then
44+
git commit -m "Update license report"
45+
git push
5146
fi
52-
53-
- name: Upload patch file
54-
if: steps.create-patch.outputs.exists == 'true'
55-
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
56-
with:
57-
path: patch
58-
name: patch

0 commit comments

Comments
 (0)