-
-
Notifications
You must be signed in to change notification settings - Fork 967
53 lines (46 loc) · 1.75 KB
/
renovate-lockfiles.yml
File metadata and controls
53 lines (46 loc) · 1.75 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: Auto-update Renovate lockfiles
on: # yamllint disable-line rule:truthy
push:
branches:
- "renovate/**"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
jobs:
update-lockfiles:
runs-on: ubuntu-latest
permissions:
contents: write # To push to the current branch
steps:
# Avoid re-running when this workflow just pushed a lockfile update
- name: Check if lockfiles were just updated
id: check-skip
env:
COMMIT_AUTHOR: ${{ github.event.head_commit.author.email }}
run: |
if [[ "$COMMIT_AUTHOR" == "github-actions[bot]@users.noreply.github.com" ]]; then
echo "skip=true" >> "$GITHUB_OUTPUT"
fi
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
if: steps.check-skip.outputs.skip != 'true'
with:
persist-credentials: true # Needed to be able to push the new lockfiles
- uses: ./.github/actions/setup-build-env
if: steps.check-skip.outputs.skip != 'true'
with:
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
mock-google-services: "true"
- name: Update lockfiles
if: steps.check-skip.outputs.skip != 'true'
run: ./gradlew alldependencies --write-locks
- name: Commit and push updated lockfiles
if: steps.check-skip.outputs.skip != 'true'
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add '*.lockfile'
if git diff --staged --quiet; then
echo "Lockfiles are already up to date"
else
git commit -m "Update dependency lockfiles"
git push
fi