mirror of
https://github.com/Cian-H/my_nvim_config.git
synced 2025-12-22 12:11:58 +00:00
Update trigger_rebuild.yaml
This commit is contained in:
17
.github/workflows/trigger_rebuild.yaml
vendored
17
.github/workflows/trigger_rebuild.yaml
vendored
@@ -18,7 +18,6 @@ jobs:
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# First test if we can access the repository
|
||||
echo "Testing repository access..."
|
||||
repo_response=$(curl -s -o /dev/null -w "%{http_code}" \
|
||||
-H "Accept: application/vnd.github+json" \
|
||||
@@ -28,21 +27,31 @@ jobs:
|
||||
|
||||
echo "Repository access status code: $repo_response"
|
||||
|
||||
# If we can access the repo, try to create the dispatch
|
||||
if [ "$repo_response" -eq 200 ]; then
|
||||
echo "Repository is accessible, attempting dispatch..."
|
||||
dispatch_response=$(curl -s -o /dev/null -w "%{http_code}" \
|
||||
-X POST \
|
||||
-H "Accept: application/vnd.github+json" \
|
||||
-H "Authorization: Bearer $GH_TOKEN" \
|
||||
-H "Content-Type: application/json" \
|
||||
-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 }}"}}')
|
||||
-d '{"event_type":"rebuild-container"}')
|
||||
|
||||
echo "Dispatch status code: $dispatch_response"
|
||||
|
||||
if [ "$dispatch_response" -ne 204 ]; then
|
||||
echo "Failed to create dispatch event"
|
||||
# Get the error message
|
||||
error_msg=$(curl -s \
|
||||
-X POST \
|
||||
-H "Accept: application/vnd.github+json" \
|
||||
-H "Authorization: Bearer $GH_TOKEN" \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "X-GitHub-Api-Version: 2022-11-28" \
|
||||
https://api.github.com/repos/Cian-H/my_nvim/dispatches \
|
||||
-d '{"event_type":"rebuild-container"}')
|
||||
|
||||
echo "Error response: $error_msg"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user