Skip to content

Commit 9d152d7

Browse files
authored
Update webhook syntax and branches (#91)
The existing readthedocs webhooks do not properly rebuild the stable branch of the docs, because if the branch is not specified, RTD instead rebuilds the "latest" branch of the docs, which is tied to branch main in this repo. This change adds the branch name to the webhook curl. If main is pushed, latest RTD will build, and if stable is pushed, stable RTD will build. If any other branch is pushed, RTD will not do anything.
1 parent bbcada5 commit 9d152d7

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

.github/workflows/sync-stable-branch.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,6 @@ jobs:
7878
RTD_WEBHOOK_SECRET: ${{ secrets.RTD_WEBHOOK_SECRET }}
7979
run: |
8080
curl -X POST \
81-
-H "Authorization: token $RTD_WEBHOOK_SECRET" \
81+
-d "branches=stable" -d "token=$RTD_WEBHOOK_SECRET" \
8282
https://readthedocs.org/api/v2/webhook/slang-documentation/296117/
83-
echo "Triggered Read the Docs build."
83+
echo "Triggered Read the Docs build for stable branch."

.github/workflows/update-submodules.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,5 +68,6 @@ jobs:
6868
RTD_WEBHOOK_SECRET: ${{ secrets.RTD_WEBHOOK_SECRET }}
6969
run: |
7070
curl -X POST \
71-
-H "Authorization: token $RTD_WEBHOOK_SECRET" \
72-
https://readthedocs.org/api/v2/webhook/slang-documentation/296117/
71+
-d "branches=${{ steps.default_branch.outputs.name }}" -d "token=$RTD_WEBHOOK_SECRET" \
72+
https://readthedocs.org/api/v2/webhook/slang-documentation/296117/
73+
echo "Triggered Read the Docs build for ${{ steps.default_branch.outputs.name }} branch."

0 commit comments

Comments
 (0)