From 0361cc618cfea71c1f5db173cf8d77ef9e181981 Mon Sep 17 00:00:00 2001 From: Cian Hughes Date: Wed, 22 Jan 2025 15:15:41 +0000 Subject: [PATCH] Update trigger_rebuild.yaml --- .github/workflows/trigger_rebuild.yaml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/trigger_rebuild.yaml b/.github/workflows/trigger_rebuild.yaml index 09d0260..5792858 100644 --- a/.github/workflows/trigger_rebuild.yaml +++ b/.github/workflows/trigger_rebuild.yaml @@ -11,10 +11,19 @@ jobs: steps: - name: Trigger container rebuild run: | - curl -L \ + response=$(curl -L \ -X POST \ -H "Accept: application/vnd.github+json" \ - -H "Authorization: Bearer ${{ secrets.PUBLIC_REPO_SYNC_TOKEN }}" \ + -H "Authorization: Bearer ${{ secrets.PAT_TOKEN }}" \ -H "X-GitHub-Api-Version: 2022-11-28" \ - https://api.github.com/repos/Cian-H/my_nvim/dispatches \ - -d '{"event_type":"rebuild-container","client_payload":{"repository":"${{ github.repository }}"}}' + -w "%{http_code}" \ + -o /dev/null \ + https://api.github.com/repos/OWNER/REPO/dispatches \ + -d '{"event_type":"rebuild-container","client_payload":{"repository":"${{ github.repository }}"}}') + + if [ "$response" -ne 200 ]; then + echo "Failed to trigger workflow. HTTP status code: $response" + exit 1 + fi + + echo "Successfully triggered workflow"