Skip to content

Daily Brief Cron

Daily Brief Cron #45

Workflow file for this run

name: Daily Brief Cron
on:
schedule:
- cron: '0 0 * * *' # midnight UTC
workflow_dispatch:
jobs:
call-narratives-endpoint:
runs-on: ubuntu-latest
steps:
- name: Call narratives endpoint to trigger brief creation
run: |
echo "::group::Triggering narratives endpoint"
for i in {1..3}; do
echo "Attempt $i..."
if curl -s -X GET "${{ vars.RENDER_URL }}/narratives" \
-H "x-api-key: ${{ secrets.API_KEY }}" \
--fail -o response.json; then
echo "Request succeeded on attempt $i."
cat response.json
echo "::endgroup::"
exit 0
else
echo "Request failed on attempt $i."
if [ $i -lt 3 ]; then
echo "Retrying in 90 seconds..."
sleep 90
fi
fi
done
echo "All attempts failed."
cat response.json || true
echo "::endgroup::"
exit 1