-
Notifications
You must be signed in to change notification settings - Fork 674
67 lines (53 loc) · 1.85 KB
/
dependabot-tasks.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: Dependabot Tasks
on:
pull_request:
branches:
- 'main' # dependabot will create PRs only against main
jobs:
# Dependabot job that runs only for dependabot PRs
# This job is writing locks, updates checksums, and commits the changes on the dependabot PRs.
lock-and-verify:
name: Lock and verify
runs-on: ubuntu-latest
env:
DEVELOCITY_ACCESS_KEY: ${{ secrets.GE_ACCESS_TOKEN }}
# Run only on PRs created by dependabot, this prevents users from misusing branch names
# prefixed with dependabot/**
if: github.actor == 'dependabot[bot]'
# Give the default GITHUB_TOKEN write permission to commit
# and push the changed files back to the repository.
permissions:
contents: write
steps:
- name: Checkout project
uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 21
java-package: jdk
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Use Gradle cache
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
key: ${{ runner.os }}-gradle-precommit-${{ hashFiles('versions.lock') }}
restore-keys: |
${{ runner.os }}-gradle-precommit-
${{ runner.os }}-gradle-
- name: Write locks
run: ./gradlew writeLocks
- name: Update licenses / checksums
run: ./gradlew updateLicenses
- name: Commit and push changes
run: |
git config user.name github-actions
git config user.email [email protected]
git add .
git commit -m "Write locks and update checksums"
git push origin ${{ github.head_ref }}