Skip to content

Commit 23ac7dc

Browse files
committed
Capture invocation ID from Lambda invoke response headers
1 parent 741460c commit 23ac7dc

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

.github/workflows/deploy-examples.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,23 @@ jobs:
111111
--payload '{"name": "World"}' \
112112
--region "${{ env.AWS_REGION }}" \
113113
--endpoint-url "$LAMBDA_ENDPOINT" \
114-
/tmp/response.json
114+
/tmp/response.json \
115+
> /tmp/invoke_response.json
116+
115117
echo "Response:"
116118
cat /tmp/response.json
119+
120+
echo "Invoke Response Headers:"
121+
cat /tmp/invoke_response.json
122+
123+
# Extract invocation ID from response headers
124+
INVOCATION_ID=$(jq -r '.ResponseMetadata.HTTPHeaders["x-amzn-invocation-id"] // empty' /tmp/invoke_response.json)
125+
if [ -n "$INVOCATION_ID" ]; then
126+
echo "INVOCATION_ID=$INVOCATION_ID" >> $GITHUB_ENV
127+
echo "Captured Invocation ID: $INVOCATION_ID"
128+
else
129+
echo "Warning: Could not capture invocation ID from response"
130+
fi
117131
118132
- name: Find Durable Execution - ${{ matrix.example.name }}
119133
env:

0 commit comments

Comments
 (0)