File tree Expand file tree Collapse file tree 1 file changed +21
-5
lines changed
Expand file tree Collapse file tree 1 file changed +21
-5
lines changed Original file line number Diff line number Diff line change 1212 - name : Call narratives endpoint to trigger brief creation
1313 run : |
1414 echo "::group::Triggering narratives endpoint"
15- curl -s -X GET "${{ vars.RENDER_URL }}/narratives" \
16- -H "x-api-key: ${{ secrets.API_KEY }}" \
17- --fail -o response.json
18- echo "Response:"
19- cat response.json
15+ for i in {1..3}; do
16+ echo "Attempt $i..."
17+ if curl -s -X GET "${{ vars.RENDER_URL }}/narratives" \
18+ -H "x-api-key: ${{ secrets.API_KEY }}" \
19+ --fail -o response.json; then
20+ echo "Request succeeded on attempt $i."
21+ cat response.json
22+ echo "::endgroup::"
23+ exit 0
24+ else
25+ echo "Request failed on attempt $i."
26+ if [ $i -lt 3 ]; then
27+ echo "Retrying in 90 seconds..."
28+ sleep 90
29+ fi
30+ fi
31+ done
32+
33+ echo "All attempts failed."
34+ cat response.json || true
2035 echo "::endgroup::"
36+ exit 1
You can’t perform that action at this time.
0 commit comments