Skip to content

Commit fc18199

Browse files
hsbtclaude
andcommitted
Automatically trigger build workflow after sync update
When update.yml detects new Ruby versions and pushes a commit, dispatch build.yml to rebuild Docker images automatically. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 9156c7b commit fc18199

2 files changed

Lines changed: 15 additions & 2 deletions

File tree

.github/workflows/build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ name: Build Docker image
22

33
on:
44
workflow_dispatch:
5+
repository_dispatch:
6+
types: [build]
57

68
permissions:
79
contents: read

.github/workflows/update.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,22 @@ jobs:
1212
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1313
- run: rake sync
1414
- name: commit and push
15+
id: commit
1516
run: |
1617
git config user.name "GitHub Actions Bot"
1718
git config user.email "github-actions[bot]@users.noreply.github.com"
1819
git add .
19-
git commit -m "rake sync"
20-
git push
20+
if git diff --cached --quiet; then
21+
echo "updated=false" >> "$GITHUB_OUTPUT"
22+
else
23+
git commit -m "rake sync"
24+
git push
25+
echo "updated=true" >> "$GITHUB_OUTPUT"
26+
fi
2127
env:
2228
GITHUB_TOKEN: ${{ secrets.MATZBOT_AUTO_UPDATE_TOKEN }}
29+
- name: dispatch build
30+
if: steps.commit.outputs.updated == 'true'
31+
run: gh workflow run build.yml
32+
env:
33+
GH_TOKEN: ${{ secrets.MATZBOT_AUTO_UPDATE_TOKEN }}

0 commit comments

Comments
 (0)