Skip to content

Commit d4d6475

Browse files
committed
adds retries to daily brief workflow
1 parent f210cbb commit d4d6475

File tree

1 file changed

+21
-5
lines changed

1 file changed

+21
-5
lines changed

.github/workflows/daily-brief.yml

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,25 @@ jobs:
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

0 commit comments

Comments
 (0)