Skip to content

Commit 84a2a9c

Browse files
authored
print logs of ephemeral instance after executing preview-cmd (#38)
1 parent 5b17176 commit 84a2a9c

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

ephemeral/startup/action.yml

+12
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ runs:
6666
6767
- name: Create preview environment
6868
shell: bash
69+
id: create-instance
6970
run: |
7071
autoLoadPod="${AUTO_LOAD_POD:-${{ inputs.auto-load-pod }}}"
7172
extensionAutoInstall="${EXTENSION_AUTO_INSTALL:-${{ inputs.extension-auto-install }}}"
@@ -111,3 +112,14 @@ runs:
111112
shell: bash
112113
run:
113114
${{ inputs.preview-cmd }}
115+
116+
- name: Print logs of ephemeral instance
117+
if: ${{ !cancelled() && steps.create-instance.outcome == 'success' }}
118+
shell: bash
119+
run: |
120+
log_response=$(curl -X GET \
121+
-H "ls-api-key: ${LOCALSTACK_API_KEY:-${{ inputs.localstack-api-key }}}" \
122+
-H "content-type: application/json" \
123+
https://api.localstack.cloud/v1/compute/instances/$previewName/logs)
124+
125+
echo "$log_response" | jq -r '.[].content'

0 commit comments

Comments
 (0)