Skip to content

Commit 8c1e8f8

Browse files
authored
Merge pull request #1449 from crazy-max/update-dist-workflow
ci: update-dist workflow
2 parents 64c9b14 + 456cabc commit 8c1e8f8

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

.github/workflows/update-dist.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: update-dist
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- synchronize
8+
9+
jobs:
10+
update-dist:
11+
if: github.actor == 'dependabot[bot]'
12+
runs-on: ubuntu-latest
13+
steps:
14+
-
15+
name: GitHub auth token from GitHub App
16+
id: docker-read-app
17+
uses: actions/create-github-app-token@v2
18+
with:
19+
app-id: ${{ secrets.GHACTIONS_REPO_WRITE_APP_ID }}
20+
private-key: ${{ secrets.GHACTIONS_REPO_WRITE_APP_PRIVATE_KEY }}
21+
owner: docker
22+
-
23+
name: Checkout
24+
uses: actions/checkout@v6
25+
with:
26+
ref: ${{ github.event.pull_request.head.ref }}
27+
fetch-depth: 0
28+
token: ${{ steps.docker-read-app.outputs.token || github.token }}
29+
-
30+
name: Build
31+
uses: docker/bake-action@v6
32+
with:
33+
source: .
34+
targets: build
35+
-
36+
name: Commit and push dist
37+
run: |
38+
if [ -n "$(git status --porcelain -- dist)" ]; then
39+
(
40+
set -x
41+
git config user.name "github-actions[bot]"
42+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
43+
git add dist
44+
git commit -m "chore: update generated content"
45+
git push
46+
)
47+
else
48+
echo "No changes in dist"
49+
fi

0 commit comments

Comments
 (0)