-
Notifications
You must be signed in to change notification settings - Fork 189
51 lines (50 loc) · 1.74 KB
/
DependencyDiff.yml
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
name: DependencyDiff
on:
pull_request:
paths:
- 'gradle/libs.versions.toml'
- '**/build.gradle.kts'
concurrency:
group: dependency-diff-${{ github.ref }}
cancel-in-progress: true
jobs:
dependency_diff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
- id: dependency-diff
name: Generate dependency diff
run: |
BRANCH_NAME="${GITHUB_HEAD_REF}"
DIFF=$(scripts/dependency_diff.sh $BASE_BRANCH $BRANCH_NAME app releaseRuntimeClasspath)
DIFF="${DIFF//'%'/'%25'}"
DIFF="${DIFF//$'\n'/'%0A'}"
DIFF="${DIFF//$'\r'/'%0D'}"
echo "::set-output name=text-diff::${DIFF}"
env:
BASE_BRANCH: ${{ github.base_ref }}
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- uses: peter-evans/find-comment@b1c41cb2fb7ede4111f49c934663a66f1a664b63
id: find_comment
with:
issue-number: ${{ github.event.pull_request.number }}
body-includes: Dependency diff
- uses: peter-evans/create-or-update-comment@1efb899c2490b300de79ecd12e7cb7d9c4263c04
if: ${{ steps.dependency-diff.outputs.text-diff != null && steps.find_comment.outputs.comment-id != null }}
with:
body: |
Dependency diff:
```diff
${{ steps.dependency-diff.outputs.text-diff }}
```
edit-mode: replace
comment-id: ${{ steps.find_comment.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
token: ${{ secrets.GITHUB_TOKEN }}