Skip to content

Commit d87644f

Browse files
committed
ci(dependabot): add workflow to automatically update dependency guard when dependabot creates a PR
1 parent 84866a1 commit d87644f

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: dependabot PR - Update dependency guard
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- synchronize
8+
- reopened
9+
branches:
10+
- main
11+
paths:
12+
- '**/*.gradle'
13+
- 'gradle/**'
14+
- 'gradlew'
15+
- '**/libs.versions.toml'
16+
17+
jobs:
18+
update-dependency-guard:
19+
if: github.actor == 'dependabot[bot]'
20+
runs-on: ubuntu-latest
21+
timeout-minutes: 90
22+
steps:
23+
- name: Checkout the repo
24+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
25+
26+
- name: Prepares environment
27+
uses: ./.github/actions/setup
28+
29+
- name: Update dependency guard
30+
run: ./gradlew :dependencyGuardBaseline
31+
32+
- name: Commit and push changes if any
33+
run: |
34+
git config --global user.name "github-actions[bot]"
35+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
36+
git add .
37+
if ! git diff --cached --quiet; then
38+
git commit -m "chore(dependency): Update dependency guard files on behalf of @dependabot"
39+
git push origin HEAD:${{ github.head_ref }}
40+
else
41+
echo "No changes to commit"
42+
fi

0 commit comments

Comments
 (0)