Skip to content

Commit 56cc8b2

Browse files
committed
ci: add job to automate dependabot pre-checkin/vendor
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
1 parent 78265e4 commit 56cc8b2

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: dependabot-build
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- 'package.json'
7+
8+
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions
9+
permissions:
10+
contents: write
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
if: github.actor == 'dependabot[bot]'
16+
steps:
17+
-
18+
name: Checkout
19+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
20+
with:
21+
ref: ${{ github.head_ref }}
22+
-
23+
name: Set up Docker Buildx
24+
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
25+
-
26+
name: Vendor
27+
uses: docker/bake-action@5be5f02ff8819ecd3092ea6b2e6261c31774f2b4 # v6.10.0
28+
with:
29+
targets: vendor
30+
-
31+
name: Pre-checkin
32+
uses: docker/bake-action@5be5f02ff8819ecd3092ea6b2e6261c31774f2b4 # v6.10.0
33+
with:
34+
targets: pre-checkin
35+
-
36+
name: Commit and push changes
37+
run: |
38+
git config user.name "github-actions[bot]"
39+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
40+
git add -A
41+
if git diff --cached --quiet; then
42+
echo "No changes to commit"
43+
else
44+
git commit -m "chore: update dist and vendor"
45+
git push
46+
fi

0 commit comments

Comments
 (0)