@@ -58,12 +58,14 @@ runs:
5858
5959 - name : Setup preview name
6060 shell : bash
61+ id : preview-name
6162 run : |
6263 prId=$(<pr-id.txt)
6364 repoName=$GITHUB_REPOSITORY
6465 repoNameCleaned=$(echo -n "$repoName" | tr -c '[:alnum:]' '-')
6566 previewName=preview-$repoNameCleaned-$prId
6667 echo "previewName=$previewName" >> $GITHUB_ENV
68+ echo "name=$previewName" >> $GITHUB_OUTPUT
6769
6870 - name : Create preview environment
6971 shell : bash
9294 }
9395
9496 fetch_instances() {
95- list_response=$(curl --fail-with-body -s - X GET \
97+ list_response=$(curl --fail-with-body -X GET \
9698 -H "$AUTH_HEADER" \
9799 -H "$CONTENT_TYPE_HEADER" \
98100 "$API_URL_BASE")
@@ -112,7 +114,7 @@ runs:
112114
113115 delete_instance() {
114116 # We expect a 200 on success or 404 if it's already gone. Other codes are errors.
115- http_code=$(curl -s - o /dev/null -w "%{http_code}" -X DELETE \
117+ http_code=$(curl -o /dev/null -w "%{http_code}" -X DELETE \
116118 -H "$AUTH_HEADER" \
117119 -H "$CONTENT_TYPE_HEADER" \
118120 "$API_URL_BASE/$previewName")
@@ -127,7 +129,7 @@ runs:
127129 fi
128130
129131 create_instance_func() {
130- response=$(curl --fail-with-body -s - X POST -d "{\"instance_name\": \"${previewName}\", \"lifetime\": ${lifetime} ,\"env_vars\": {\"AUTO_LOAD_POD\": \"${autoLoadPod}\", \"EXTENSION_AUTO_INSTALL\": \"${extensionAutoInstall}\"}}"\
132+ response=$(curl --fail-with-body -X POST -d "{\"instance_name\": \"${previewName}\", \"lifetime\": ${lifetime} ,\"env_vars\": {\"AUTO_LOAD_POD\": \"${autoLoadPod}\", \"EXTENSION_AUTO_INSTALL\": \"${extensionAutoInstall}\"}}"\
131133 -H "$AUTH_HEADER" \
132134 -H "$CONTENT_TYPE_HEADER" \
133135 "$API_URL_BASE")
@@ -156,12 +158,14 @@ runs:
156158 - name : Run preview deployment
157159 if : ${{ inputs.preview-cmd != '' }}
158160 shell : bash
159- run :
161+ run : |
160162 ${{ inputs.preview-cmd }}
161163
162164 - name : Print logs of ephemeral instance
163165 if : ${{ !cancelled() && steps.create-instance.outcome == 'success' }}
164166 shell : bash
167+ env :
168+ previewName : ${{ steps.preview-name.outputs.name }}
165169 run : |
166170 AUTH_HEADER="ls-api-key: ${LOCALSTACK_AUTH_TOKEN:-${LOCALSTACK_API_KEY:-${{ inputs.localstack-auth-token }}}}"
167171 CONTENT_TYPE_HEADER="content-type: application/json"
0 commit comments