Skip to content

Commit 138f70c

Browse files
committed
Create notify-textbook.yml
1 parent 33d1252 commit 138f70c

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Notify textbook repo of update
2+
on:
3+
push:
4+
branches: [main]
5+
6+
jobs:
7+
dispatch:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Trigger sync in ecc-textbook.notebooks
11+
env:
12+
TOKEN: ${{ secrets.ECC_TEXTBOOK_PAT }}
13+
REPO: ${{ github.repository }}
14+
run: |
15+
# Extract folder name (ecc-physics → ecc-physics)
16+
FOLDER_NAME="${REPO##*/}"
17+
18+
curl -s -X POST \
19+
-H "Authorization: token $TOKEN" \
20+
-H "Accept: application/vnd.github+json" \
21+
https://api.github.com/repos/ds-modules/ecc-textbook.notebooks/dispatches \
22+
-d "{\"event_type\": \"sync-module\", \
23+
\"client_payload\": {\"source_repo\": \"${REPO}\", \
24+
\"folder_name\": \"${FOLDER_NAME}\"}}"

0 commit comments

Comments
 (0)