Skip to content

Commit 5ebb8a1

Browse files
authored
Merge pull request #41 from crazy-max/fix-update-dist
ci: fix update-dist workflow
2 parents 7502d43 + 018a8a7 commit 5ebb8a1

1 file changed

Lines changed: 28 additions & 14 deletions

File tree

.github/workflows/update-dist.yml

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ jobs:
1010
prepare:
1111
if: github.actor == 'dependabot[bot]'
1212
runs-on: ubuntu-latest
13-
outputs:
14-
token: ${{ steps.docker-read-app.outputs.token }}
1513
steps:
1614
-
1715
name: GitHub auth token from GitHub App
@@ -21,15 +19,31 @@ jobs:
2119
app-id: ${{ secrets.GHACTIONS_REPO_WRITE_APP_ID }}
2220
private-key: ${{ secrets.GHACTIONS_REPO_WRITE_APP_PRIVATE_KEY }}
2321
owner: docker
24-
25-
update-dist:
26-
if: github.actor == 'dependabot[bot]'
27-
uses: docker/actions-toolkit/.github/workflows/action-dist-update.yml@action-dist-update
28-
needs:
29-
- prepare
30-
permissions:
31-
contents: write
32-
with:
33-
target: build
34-
secrets:
35-
github-token: ${{ needs.prepare.outputs.token }}
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)