Skip to content

Commit

Permalink
fix(ci): fail dispatch analytics job when Lambda call fails (#3579)
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenfonseca committed Jan 2, 2024
1 parent 51bc8bc commit fcaca79
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions .github/workflows/dispatch_analytics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,16 @@ jobs:
- name: Invoke Lambda function
run: |
payload=$(echo -n '{"githubToken": "${{ secrets.GITHUB_TOKEN }}"}' | base64)
aws lambda invoke \
--function-name ${{ secrets.AWS_ANALYTICS_DISPATCHER_ARN }} \
--payload "$payload" response.json
cat response.json
response=$(aws lambda invoke \
--function-name "${{ secrets.AWS_ANALYTICS_DISPATCHER_ARN }}" \
--payload "$payload" \
response.json \
--query 'FunctionError' \
--output text)
cat response.json ; echo # add newline at the end
if [ "$response" != "None" ]; then
echo "Error invoking lambda function: $response. Aborting."
exit 1
fi

0 comments on commit fcaca79

Please sign in to comment.