Skip to content

build: repository_dispatchに対応 #1

build: repository_dispatchに対応

build: repository_dispatchに対応 #1

name: Notify App Hub
on:
push:
branches: [main]
jobs:
dispatch:
runs-on: ubuntu-latest
steps:
- name: Dispatch app-hub rebuild
env:
APP_HUB_DISPATCH_TOKEN: ${{ secrets.APP_HUB_DISPATCH_TOKEN }}
run: |
if [ -z "${APP_HUB_DISPATCH_TOKEN}" ]; then
echo "APP_HUB_DISPATCH_TOKEN is not set"
exit 1
fi
payload=$(printf '{"event_type":"tool_updated","client_payload":{"repo":"%s","sha":"%s"}}' "${GITHUB_REPOSITORY}" "${GITHUB_SHA}")
curl -sS -X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${APP_HUB_DISPATCH_TOKEN}" \
https://api.github.com/repos/big-mon/app-hub/dispatches \
-d "${payload}"