Skip to content

Commit a9d3068

Browse files
committed
build: repository_dispatchに対応
1 parent 26a38e7 commit a9d3068

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Notify App Hub
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
jobs:
8+
dispatch:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Dispatch app-hub rebuild
12+
env:
13+
APP_HUB_DISPATCH_TOKEN: ${{ secrets.APP_HUB_DISPATCH_TOKEN }}
14+
run: |
15+
if [ -z "${APP_HUB_DISPATCH_TOKEN}" ]; then
16+
echo "APP_HUB_DISPATCH_TOKEN is not set"
17+
exit 1
18+
fi
19+
20+
payload=$(printf '{"event_type":"tool_updated","client_payload":{"repo":"%s","sha":"%s"}}' "${GITHUB_REPOSITORY}" "${GITHUB_SHA}")
21+
22+
curl -sS -X POST \
23+
-H "Accept: application/vnd.github+json" \
24+
-H "Authorization: Bearer ${APP_HUB_DISPATCH_TOKEN}" \
25+
https://api.github.com/repos/big-mon/app-hub/dispatches \
26+
-d "${payload}"

0 commit comments

Comments
 (0)