]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
.github: Fix RTD build retrigger 63143/head
authorDavid Galloway <david.galloway@ibm.com>
Tue, 6 May 2025 21:31:03 +0000 (17:31 -0400)
committerDavid Galloway <david.galloway@ibm.com>
Thu, 8 May 2025 16:38:33 +0000 (12:38 -0400)
Fixes: https://tracker.ceph.com/issues/70430
Signed-off-by: David Galloway <david.galloway@ibm.com>
.github/workflows/retrigger-rtd.yml

index 8751089233c5ad359ddaf0384304c16d11b55a37..daa4ae70f72518328e2f2ccdf4591ab4afb1e2e9 100644 (file)
@@ -1,4 +1,4 @@
-name: Retrigger Read the Docs Build
+name: Retrigger RTD build on PR comment
 
 on:
   issue_comment:
@@ -6,7 +6,6 @@ on:
 
 permissions:
   contents: read
-  issues: read
   pull-requests: read
 
 jobs:
@@ -16,27 +15,11 @@ jobs:
          contains(github.event.comment.body, 'jenkins rebuild docs') || 
          contains(github.event.comment.body, 'jenkins retrigger docs'))
     runs-on: ubuntu-latest
-    steps:
-      - name: Extract PR Branch Name
-        run: |
-          PR_URL="${{ github.event.issue.pull_request.url }}"
-          PR_BRANCH=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" "${PR_URL}" | jq -r .head.ref)
-          echo "PR_BRANCH=${PR_BRANCH}" >> $GITHUB_ENV
-          echo "Detected PR Branch: ${PR_BRANCH}"
 
-      - name: Send Webhook to Read the Docs
+    steps:
+      - name: Trigger Read the Docs build
         run: |
-          PAYLOAD=$(jq -n \
-            --arg ref "refs/heads/${{ env.PR_BRANCH }}" \
-            --arg repo "${{ github.event.repository.name }}" \
-            --arg owner "${{ github.repository_owner }}" \
-            '{event: "push", ref: $ref, repository: {name: $repo, owner: {login: $owner}}}')
-
-          SECRET="${{ secrets.READTHEDOCS_API_TOKEN }}"
-          SIGNATURE=$(echo -n "$PAYLOAD" | openssl dgst -sha256 -hmac "$SECRET" | awk '{print $2}')
-
           curl -X POST \
-            -H "Content-Type: application/json" \
-            -H "X-Hub-Signature-256: sha256=$SIGNATURE" \
-            -d "$PAYLOAD" \
-            ${{ secrets.READTHEDOCS_WEBHOOK_URL }}
+            "https://readthedocs.org/api/v3/projects/ceph/versions/${{ github.event.issue.number }}/builds/" \
+            -H "Authorization: Token ${{ secrets.READTHEDOCS_API_TOKEN }}" \
+            -H "Content-Type: application/json"