Skip to content

Commit 381b4d3

Browse files
chore: add monorepo sync workflow
0 parents  commit 381b4d3

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Template: place this in each mirror repo as .github/workflows/notify-monorepo.yml
2+
#
3+
# Uses the org-wide GIT_TOKEN secret (PAT with repo scope).
4+
name: Notify Monorepo
5+
6+
on:
7+
push:
8+
branches: [main]
9+
10+
jobs:
11+
notify:
12+
name: Trigger monorepo sync
13+
runs-on: ubuntu-latest
14+
# Only trigger if the push was NOT from the monorepo sync bot
15+
if: github.actor != 'github-actions[bot]'
16+
steps:
17+
- name: Dispatch to monorepo
18+
run: |
19+
curl -sf -X POST \
20+
-H "Authorization: token ${{ secrets.GIT_TOKEN }}" \
21+
-H "Accept: application/vnd.github.v3+json" \
22+
"https://api.github.com/repos/sferarc/pgbeam/dispatches" \
23+
-d '{
24+
"event_type": "mirror-push",
25+
"client_payload": {
26+
"mirror": "${{ github.event.repository.name }}",
27+
"sha": "${{ github.sha }}"
28+
}
29+
}'

0 commit comments

Comments
 (0)