Skip to content

Commit

Permalink
print logs of ephemeral instance after executing preview-cmd (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukqw authored Aug 20, 2024
1 parent 5b17176 commit 84a2a9c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions ephemeral/startup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ runs:
- name: Create preview environment
shell: bash
id: create-instance
run: |
autoLoadPod="${AUTO_LOAD_POD:-${{ inputs.auto-load-pod }}}"
extensionAutoInstall="${EXTENSION_AUTO_INSTALL:-${{ inputs.extension-auto-install }}}"
Expand Down Expand Up @@ -111,3 +112,14 @@ runs:
shell: bash
run:
${{ inputs.preview-cmd }}

- name: Print logs of ephemeral instance
if: ${{ !cancelled() && steps.create-instance.outcome == 'success' }}
shell: bash
run: |
log_response=$(curl -X GET \
-H "ls-api-key: ${LOCALSTACK_API_KEY:-${{ inputs.localstack-api-key }}}" \
-H "content-type: application/json" \
https://api.localstack.cloud/v1/compute/instances/$previewName/logs)
echo "$log_response" | jq -r '.[].content'

0 comments on commit 84a2a9c

Please sign in to comment.