Skip to content

Commit ef92466

Browse files
Merge pull request #49 from easyshellworld/dev
fix test bug
2 parents fb00046 + 12f3b79 commit ef92466

1 file changed

Lines changed: 27 additions & 8 deletions

File tree

.github/workflows/CI-CD.yml

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,23 +55,42 @@ jobs:
5555

5656
deploy:
5757
runs-on: ubuntu-latest
58-
environment: delpoy
58+
environment: delpoy
5959
needs: [changes, quality-check]
6060
if: |
6161
github.ref == 'refs/heads/main' &&
6262
github.event_name == 'push' &&
6363
needs.changes.outputs.should_deploy == 'true'
6464
steps:
65+
- name: Debug secrets availability
66+
run: |
67+
echo "Checking if secrets are available..."
68+
if [ -n "${{ secrets.COOLIFY_WEBHOOK_URL }}" ]; then
69+
echo "✅ COOLIFY_WEBHOOK_URL is set"
70+
else
71+
echo "❌ COOLIFY_WEBHOOK_URL is NOT set"
72+
exit 1
73+
fi
74+
if [ -n "${{ secrets.COOLIFY_TOKEN }}" ]; then
75+
echo "✅ COOLIFY_TOKEN is set"
76+
else
77+
echo "❌ COOLIFY_TOKEN is NOT set"
78+
exit 1
79+
fi
80+
6581
- name: Trigger Coolify webhook
6682
run: |
67-
response=$(curl --request GET '${{ secrets.COOLIFY_WEBHOOK_URL }}' \
68-
--header 'Authorization: Bearer ${{ secrets.COOLIFY_TOKEN }}' \
69-
--write-out '%{http_code}' \
70-
--silent \
71-
--output /dev/null)
83+
# 使用更简单的 curl 语法避免复杂 shell 脚本问题
84+
status_code=$(curl -s -o /dev/null -w "%{http_code}" \
85+
-X GET \
86+
-H "Authorization: Bearer ${{ secrets.COOLIFY_TOKEN }}" \
87+
"${{ secrets.COOLIFY_WEBHOOK_URL }}")
88+
89+
echo "Webhook response status: $status_code"
7290
73-
if [ "$response" -eq 200 ] || [ "$response" -eq 201 ]; then
91+
if [ "$status_code" -eq 200 ] || [ "$status_code" -eq 201 ]; then
7492
echo "✅ Deployment webhook triggered successfully"
7593
else
76-
echo "❌ Deployment webhook failed with status: $response"
94+
echo "❌ Deployment webhook failed with status: $status_code"
7795
exit 1
96+
fi

0 commit comments

Comments
 (0)