-
Notifications
You must be signed in to change notification settings - Fork 22
61 lines (52 loc) · 1.76 KB
/
dependencies-update.yaml
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
54
55
56
57
58
59
60
61
name: "Update DEPENDENCIES file"
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Cache maven packages
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Generate Dependencies file
run: mvn org.eclipse.dash:license-tool-plugin:license-check -Ddash.summary=DEPENDENCIES
- name: Check if file was changed
run: |
if git diff --name-only ${{ github.base_ref }}...${{ github.sha }} | grep -e 'DEPENDENCIES'; then
echo "The file was changed"
echo "was_file_changed=true" >> "$GITHUB_ENV"
git
else
echo "The file was not changed"
echo "was_file_changed=false" >> "$GITHUB_ENV"
fi
- name: Configure Git
if: ${{ env.was_file_changed }} == 'true'
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
- name: Create pull request
if: ${{ env.was_file_changed }} == 'true'
uses: peter-evans/create-pull-request@v5
with:
add-paths: |
DEPENDENCIES
token: ${{ secrets.GITHUB_TOKEN }}
branch: chore/update-DEPENDENCIES
commit-message: "chore(dependencies): Update DEPENDENCIES"
delete-branch: true
title: Update DEPENDENCIES
body: |
This PR updates the DEPENDENCIES