Repository navigation
53 lines (45 loc) · 1.65 KB
/
Copy pathpull-request-helper.yml
File metadata and controls
53 lines (45 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: Pull request helper
on:
pull_request:
types: [opened, synchronize, reopened]
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
pull-request-helper:
if: >-
github.event.pull_request.user.login == 'dependabot[bot]' &&
github.event.pull_request.head.repo.id == github.event.repository.id
runs-on: ubuntu-latest
steps:
- name: Checkout exact PR head
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ github.event.pull_request.head.sha }}
persist-credentials: false
- name: Setup Gradle
uses: gradle/actions/setup-gradle@3f5f9adaf7d9fecd50b5935e54106014257a94e6 # v6.4.0
with:
cache-read-only: true
- name: Update lock files
run: ./gradlew resolveAndLockAll --write-locks
- name: Update license report
run: ./gradlew generateLicenseReport --no-build-cache
- name: Create generated-file patch
id: patch
run: |
git add '*.lockfile' licenses/
if git diff --cached --quiet; then
exit 0
fi
git diff --cached > "$RUNNER_TEMP/changes.patch"
echo "changed=true" >> "$GITHUB_OUTPUT"
- name: Upload generated changes
if: steps.patch.outputs.changed == 'true'
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: pr-helper-${{ github.run_id }}-${{ github.run_attempt }}
path: ${{ runner.temp }}/changes.patch
if-no-files-found: error