Skip to content

Commit 605481b

Browse files
committed
[fix] remove '-u' from summary tasks
1 parent c99c848 commit 605481b

8 files changed

Lines changed: 222 additions & 147 deletions

File tree

actions/aws-cloudfront-invalidation/action.yml

Lines changed: 37 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -189,56 +189,67 @@ runs:
189189
190190
- name: Summary
191191
if: always() && inputs.show_summary == 'true'
192+
continue-on-error: true
192193
shell: bash
194+
env:
195+
LIMIT: ${{ inputs.summary_limit }}
196+
DIST: ${{ inputs.distribution_id }}
197+
PATHS_RAW: ${{ inputs.paths }}
198+
WAIT_FOR_COMPLETION: ${{ inputs.wait_for_completion }}
199+
INVALIDATION_ID: ${{ steps.invalidate.outputs.invalidation_id }}
200+
INVALIDATION_STATUS: ${{ steps.invalidate.outputs.status }}
201+
CALLER_REFERENCE: ${{ steps.invalidate.outputs.caller_reference }}
193202
run: |
194-
set -euo pipefail
203+
set -eo pipefail
204+
[[ "$LIMIT" =~ ^[0-9]+$ ]] || LIMIT=250
195205
196206
STATUS_ICON="❌"
197-
[[ -n "${{ steps.invalidate.outputs.invalidation_id }}" ]] && STATUS_ICON="✅"
207+
[ -n "${INVALIDATION_ID:-}" ] && STATUS_ICON="✅"
198208
199-
DIST="${{ inputs.distribution_id }}"
200-
ID="${{ steps.invalidate.outputs.invalidation_id }}"
201209
CF_LINK=""
202-
if [[ -n "$DIST" && -n "$ID" ]]; then
203-
CF_LINK="https://console.aws.amazon.com/cloudfront/v4/home#/distributions/${DIST}/invalidations/${ID}"
210+
if [ -n "${DIST:-}" ] && [ -n "${INVALIDATION_ID:-}" ]; then
211+
CF_LINK="https://console.aws.amazon.com/cloudfront/v4/home#/distributions/${DIST}/invalidations/${INVALIDATION_ID}"
204212
fi
205213
206-
LIMIT="${{ inputs.summary_limit }}"
207-
[[ "$LIMIT" =~ ^[0-9]+$ ]] || LIMIT="250"
208-
209-
PATHS_RAW='${{ inputs.paths }}'
210-
214+
RAW="${PATHS_RAW//$'\n'/ }"
211215
set -f
212-
IFS=' ' read -r -a P_ARR <<< "$PATHS_RAW"
216+
IFS=' ' read -r -a P_ARR <<< "${RAW}"
213217
set +f
214218
215-
TOTAL="${#P_ARR[@]}"
216-
SHOW="$LIMIT"; (( TOTAL < LIMIT )) && SHOW="$TOTAL"
219+
PATHS=()
220+
for p in "${P_ARR[@]}"; do
221+
[ -n "$p" ] && PATHS+=("$p")
222+
done
223+
224+
TOTAL="${#PATHS[@]}"
225+
SHOW="$LIMIT"; [ "$TOTAL" -lt "$LIMIT" ] && SHOW="$TOTAL"
217226
218227
{
219228
echo "## 📊 CloudFront Invalidation ${STATUS_ICON}"
220-
echo "- **Invalidation ID:** \`${ID:-N/A}\`"
221-
echo "- **Status:** \`${{ steps.invalidate.outputs.status || 'N/A' }}\`"
222-
echo "- **CallerReference:** \`${{ steps.invalidate.outputs.caller_reference || 'auto' }}\`"
223-
echo "- **Distribution:** \`${DIST}\`"
224-
echo ""
225-
if (( TOTAL > 0 )); then
226-
if (( TOTAL <= LIMIT )); then
229+
echo "- **Invalidation ID:** \`${INVALIDATION_ID:-N/A}\`"
230+
echo "- **Status:** \`${INVALIDATION_STATUS:-N/A}\`"
231+
echo "- **CallerReference:** \`${CALLER_REFERENCE:-auto}\`"
232+
echo "- **Distribution:** \`${DIST:-}\`"
233+
[ -n "$CF_LINK" ] && echo "- **Console:** ${CF_LINK}"
234+
235+
echo
236+
if [ "$TOTAL" -gt 0 ]; then
237+
if [ "$TOTAL" -le "$LIMIT" ]; then
227238
echo "### Paths"
228239
else
229240
echo "### Paths (first ${LIMIT} of ${TOTAL})"
230241
fi
231242
echo '```'
232-
for ((i=0;i<SHOW;i++)); do
233-
printf '%s\n' "${P_ARR[i]}"
243+
for ((i=0; i<SHOW; i++)); do
244+
printf '%s\n' "${PATHS[i]}"
234245
done
235246
echo '```'
236247
fi
237248
238-
echo ""
239-
if [[ "${{ inputs.wait_for_completion }}" == "true" ]]; then
249+
echo
250+
if [ "${WAIT_FOR_COMPLETION:-false}" = "true" ]; then
240251
echo "⏱️ Waited for completion: **true**"
241252
else
242253
echo "⏱️ Waited for completion: **false** (status may change to *Completed* in ~10–15 minutes)"
243254
fi
244-
} >> "$GITHUB_STEP_SUMMARY"
255+
} >> "${GITHUB_STEP_SUMMARY:-/dev/null}" || true

actions/aws-lambda-restart/action.yml

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -201,29 +201,37 @@ runs:
201201
202202
- name: Summary
203203
if: always() && inputs.show_summary == 'true'
204+
continue-on-error: true
204205
shell: bash
206+
env:
207+
LIMIT: ${{ inputs.summary_limit }}
208+
UPDATE_OUTCOME: ${{ steps.update_code.outcome }}
209+
FUNCTION_NAME: ${{ inputs.function_name }}
210+
AWS_REGION: ${{ inputs.aws_region }}
211+
IMAGE_URI: ${{ steps.resolve_image.outputs.image_uri }}
212+
FUNCTION_ARN: ${{ steps.update_code.outputs.function_arn }}
213+
CODE_SHA256: ${{ steps.update_code.outputs.code_sha256 }}
214+
LAST_MODIFIED: ${{ steps.update_code.outputs.last_modified }}
215+
WAIT_FOR_UPDATE: ${{ inputs.wait_for_update }}
205216
run: |
206-
set -euo pipefail
217+
set -eo pipefail
218+
[[ "$LIMIT" =~ ^[0-9]+$ ]] || LIMIT=250
207219
208220
STATUS_ICON="❌"
209-
if [[ "${{ steps.update_code.outcome }}" == "success" ]]; then
210-
STATUS_ICON="✅"
211-
fi
212-
213-
LIMIT="${{ inputs.summary_limit }}"
214-
[[ "$LIMIT" =~ ^[0-9]+$ ]] || LIMIT="250"
221+
[ "${UPDATE_OUTCOME:-failure}" = "success" ] && STATUS_ICON="✅"
215222
216223
{
217224
echo "## 🚀 Lambda Update ${STATUS_ICON}"
218-
echo "- **Function:** \`${{ inputs.function_name }}\`"
219-
echo "- **Region:** \`${{ inputs.aws_region }}\`"
220-
echo "- **Image:** \`${{ steps.resolve_image.outputs.image_uri || 'N/A' }}\`"
221-
if [[ "${{ steps.update_code.outcome }}" == "success" ]]; then
222-
echo "- **Function ARN:** \`${{ steps.update_code.outputs.function_arn || 'N/A' }}\`"
223-
echo "- **Code SHA256:** \`${{ steps.update_code.outputs.code_sha256 || 'N/A' }}\`"
224-
echo "- **Last Modified:** \`${{ steps.update_code.outputs.last_modified || 'N/A' }}\`"
225-
echo "- **Waited for Active:** \`${{ inputs.wait_for_update }}\`"
225+
echo "- **Function:** \`${FUNCTION_NAME:-}\`"
226+
echo "- **Region:** \`${AWS_REGION:-}\`"
227+
echo "- **Image:** \`${IMAGE_URI:-N/A}\`"
228+
229+
if [ "${UPDATE_OUTCOME:-failure}" = "success" ]; then
230+
echo "- **Function ARN:** \`${FUNCTION_ARN:-N/A}\`"
231+
echo "- **Code SHA256:** \`${CODE_SHA256:-N/A}\`"
232+
echo "- **Last Modified:** \`${LAST_MODIFIED:-N/A}\`"
233+
echo "- **Waited for Active:** \`${WAIT_FOR_UPDATE:-false}\`"
226234
else
227-
echo "- **Status:** Update failed — check logs above"
235+
echo "- **Status:** Update failed — check logs for details"
228236
fi
229-
} >> "$GITHUB_STEP_SUMMARY"
237+
} >> "${GITHUB_STEP_SUMMARY:-/dev/null}" || true

actions/aws-s3-sync/action.yml

Lines changed: 40 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -247,35 +247,53 @@ runs:
247247
248248
- name: Summary
249249
if: always() && inputs.show_summary == 'true'
250+
continue-on-error: true
250251
shell: bash
252+
env:
253+
LIMIT: ${{ inputs.summary_limit }}
254+
OUTCOME: ${{ steps.sync.outcome }}
255+
BUCKET: ${{ inputs.bucket_name }}
256+
SOURCE_DIR: ${{ inputs.source_dir }}
257+
S3_URL: ${{ steps.url.outputs.s3_url }}
258+
AWS_REGION: ${{ inputs.aws_region }}
259+
DELETE_REMOVED: ${{ inputs.delete_removed }}
260+
CACHE_CONTROL: ${{ inputs.cache_control }}
261+
CT_DETECTION: ${{ inputs.content_type_detection }}
262+
EXCLUDES: ${{ inputs.exclude_patterns }}
263+
FILES_UPLOADED: ${{ steps.sync.outputs.files_uploaded }}
264+
FILES_DELETED: ${{ steps.sync.outputs.files_deleted }}
265+
FILE_COUNT: ${{ steps.analyze.outputs.file_count }}
266+
TOTAL_SIZE: ${{ steps.analyze.outputs.total_size }}
267+
SYNC_DURATION: ${{ steps.sync.outputs.sync_duration }}
251268
run: |
252-
set -euo pipefail
269+
set -eo pipefail
270+
[[ "$LIMIT" =~ ^[0-9]+$ ]] || LIMIT=250
253271
254-
OUTCOME="${{ steps.sync.outcome }}"
255-
STATUS_ICON="❌"; [[ "$OUTCOME" == "success" ]] && STATUS_ICON="✅"
256-
BYTES="${{ steps.analyze.outputs.total_size || 0 }}"
257-
MB=$(awk "BEGIN {printf \"%.2f\", (${BYTES})/1024/1024}")
272+
STATUS_ICON="❌"
273+
[ "${OUTCOME:-failure}" = "success" ] && STATUS_ICON="✅"
258274
259-
LIMIT="${{ inputs.summary_limit }}"
260-
[[ "$LIMIT" =~ ^[0-9]+$ ]] || LIMIT="250"
275+
BYTES="${TOTAL_SIZE:-0}"
276+
if [[ -z "$BYTES" || ! "$BYTES" =~ ^[0-9]+$ ]]; then BYTES=0; fi
277+
MB=$(awk "BEGIN {printf \"%.2f\", ($BYTES)/1024/1024}")
261278
262279
{
263280
echo "## ☁️ S3 Sync ${STATUS_ICON}"
264-
echo "- **Bucket:** \`${{ inputs.bucket_name }}\`"
265-
echo "- **Source:** \`${{ inputs.source_dir }}\`"
266-
echo "- **Target:** \`${{ steps.url.outputs.s3_url }}\`"
267-
echo "- **Region:** \`${{ inputs.aws_region }}\`"
268-
echo "- **Delete removed:** \`${{ inputs.delete_removed }}\`"
269-
echo "- **Cache-Control:** \`${{ inputs.cache_control || 'N/A' }}\`"
270-
echo "- **Content-Type detection:** \`${{ inputs.content_type_detection }}\`"
271-
echo "- **Excludes:** \`${{ inputs.exclude_patterns }}\`"
272-
if [[ "$OUTCOME" == "success" ]]; then
273-
echo "- **Files uploaded:** \`${{ steps.sync.outputs.files_uploaded || '0' }}\`"
274-
echo "- **Files deleted:** \`${{ steps.sync.outputs.files_deleted || '0' }}\`"
275-
echo "- **Total files:** \`${{ steps.analyze.outputs.file_count || '0' }}\`"
281+
echo "- **Bucket:** \`${BUCKET:-}\`"
282+
echo "- **Source:** \`${SOURCE_DIR:-}\`"
283+
echo "- **Target:** \`${S3_URL:-}\`"
284+
echo "- **Region:** \`${AWS_REGION:-}\`"
285+
echo "- **Delete removed:** \`${DELETE_REMOVED:-false}\`"
286+
echo "- **Cache-Control:** \`${CACHE_CONTROL:-N/A}\`"
287+
echo "- **Content-Type detection:** \`${CT_DETECTION:-true}\`"
288+
echo "- **Excludes:** \`${EXCLUDES:-}\`"
289+
290+
if [ "${OUTCOME:-failure}" = "success" ]; then
291+
echo "- **Files uploaded:** \`${FILES_UPLOADED:-0}\`"
292+
echo "- **Files deleted:** \`${FILES_DELETED:-0}\`"
293+
echo "- **Total files:** \`${FILE_COUNT:-0}\`"
276294
echo "- **Total size:** \`${BYTES}\` bytes (~${MB} MiB)"
277-
echo "- **Sync duration:** \`${{ steps.sync.outputs.sync_duration || 'N/A' }}\` seconds"
295+
echo "- **Sync duration:** \`${SYNC_DURATION:-N/A}\` seconds"
278296
else
279-
echo "- **Status:** Sync failed — check logs above"
297+
echo "- **Status:** Sync failed — check logs for details"
280298
fi
281-
} >> "$GITHUB_STEP_SUMMARY"
299+
} >> "${GITHUB_STEP_SUMMARY:-/dev/null}" || true

actions/aws-terraform-runner/action.yml

Lines changed: 39 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -242,35 +242,51 @@ runs:
242242
243243
- name: Terraform Summary
244244
if: inputs.show_summary != 'false'
245+
continue-on-error: true
245246
shell: bash
246247
working-directory: ${{ inputs.tf_dir }}
248+
env:
249+
LIMIT: ${{ inputs.summary_limit }}
250+
TF_COMMAND: ${{ inputs.tf_command }}
251+
TF_DIR: ${{ inputs.tf_dir }}
252+
TF_WORKSPACE: ${{ inputs.tf_workspace }}
253+
TF_VERSION: ${{ steps.collect.outputs.terraform_version }}
254+
BACKEND_BUCKET: ${{ inputs.backend_bucket }}
255+
BACKEND_KEY: ${{ inputs.backend_key }}
256+
BACKEND_REGION: ${{ inputs.backend_region }}
257+
AWS_REGION: ${{ inputs.aws_region }}
247258
run: |
248-
set -euo pipefail
249-
250-
WS="${{ inputs.tf_workspace != '' && inputs.tf_workspace || 'default' }}"
251-
TFV="${{ steps.collect.outputs.terraform_version }}"
259+
set -eo pipefail
260+
[[ "$LIMIT" =~ ^[0-9]+$ ]] || LIMIT=250
252261
253-
LIMIT_RAW="${{ inputs.summary_limit }}"
254-
if ! [[ "$LIMIT_RAW" =~ ^[0-9]+$ ]]; then LIMIT=250; else LIMIT="$LIMIT_RAW"; fi
262+
WS="${TF_WORKSPACE:-}"
263+
[ -z "$WS" ] && WS="default"
255264
256265
{
257266
echo "## 🛠️ Terraform Execution Summary"
258-
echo "- **Command:** \`${{ inputs.tf_command }}\`"
259-
echo "- **Directory:** \`${{ inputs.tf_dir }}\`"
260-
echo "- **Workspace:** \`$WS\`"
261-
echo "- **Terraform version:** \`$TFV\`"
262-
echo "- **Backend:** S3 \`${{ inputs.backend_bucket }}:${{ inputs.backend_key }}\`"
263-
echo " in \`${{ inputs.backend_region }}\`"
264-
echo "- **AWS region (vars):** \`${{ inputs.aws_region }}\`"
265-
266-
if [[ "${{ inputs.tf_command }}" == "plan" && -f "tfplan" ]]; then
267-
echo ""
268-
TOTAL_LINES=$(terraform show -no-color tfplan | wc -l | awk '{print $1}')
269-
echo "### 📄 Plan (first ${LIMIT} lines${TOTAL_LINES:+ of ${TOTAL_LINES}})"
270-
terraform show -no-color tfplan | sed -n "1,${LIMIT}p"
271-
if [[ -n "$TOTAL_LINES" && "$TOTAL_LINES" -gt "$LIMIT" ]]; then
272-
echo ""
273-
echo "_…truncated, total lines: $TOTAL_LINES_"
267+
echo "- **Command:** \`${TF_COMMAND:-}\`"
268+
echo "- **Directory:** \`${TF_DIR:-.}\`"
269+
echo "- **Workspace:** \`${WS}\`"
270+
[ -n "${TF_VERSION:-}" ] && echo "- **Terraform version:** \`${TF_VERSION}\`"
271+
if [ -n "${BACKEND_BUCKET:-}" ] && [ -n "${BACKEND_KEY:-}" ]; then
272+
echo "- **Backend:** S3 \`${BACKEND_BUCKET}:${BACKEND_KEY}\`"
273+
[ -n "${BACKEND_REGION:-}" ] && echo " in \`${BACKEND_REGION}\`"
274+
fi
275+
[ -n "${AWS_REGION:-}" ] && echo "- **AWS region (vars):** \`${AWS_REGION}\`"
276+
277+
if [ "${TF_COMMAND:-}" = "plan" ] && [ -f tfplan ]; then
278+
echo
279+
if command -v terraform >/dev/null 2>&1; then
280+
TOTAL_LINES=$(terraform show -no-color tfplan | wc -l | awk '{print $1}')
281+
echo "### 📄 Plan (first ${LIMIT} lines${TOTAL_LINES:+ of ${TOTAL_LINES}})"
282+
terraform show -no-color tfplan | sed -n "1,${LIMIT}p"
283+
if [ -n "${TOTAL_LINES:-}" ] && [ "$TOTAL_LINES" -gt "$LIMIT" ]; then
284+
echo
285+
echo "_…truncated, total lines: $TOTAL_LINES_"
286+
fi
287+
else
288+
echo "### 📄 Plan"
289+
echo "_terraform binary not available to render plan output_"
274290
fi
275291
fi
276-
} >> "$GITHUB_STEP_SUMMARY"
292+
} >> "${GITHUB_STEP_SUMMARY:-/dev/null}" || true

actions/docker-build-push/action.yml

Lines changed: 36 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,7 @@ runs:
282282
283283
- name: Summary
284284
if: always() && inputs.show_summary == 'true'
285+
continue-on-error: true
285286
shell: bash
286287
env:
287288
BUILD_ARGS_JSON: ${{ inputs.build_args }}
@@ -291,50 +292,60 @@ runs:
291292
REPO: ${{ inputs.repository }}
292293
TAG: ${{ inputs.tag }}
293294
LIMIT: ${{ inputs.summary_limit }}
295+
CONTEXT: ${{ steps.ctx.outputs.context }}
296+
DOCKERFILE_PATH: ${{ inputs.dockerfile_path }}
297+
BUILD_OUTCOME: ${{ steps.build.outcome }}
298+
DIGEST: ${{ steps.resolve_digest.outputs.digest }}
299+
IMAGE_SIZE: ${{ steps.resolve_digest.outputs.image_size }}
300+
IMAGE_REF: ${{ steps.resolve_digest.outputs.image_ref }}
301+
BUILD_DURATION: ${{ steps.build.outputs.build_duration }}
294302
run: |
295-
set -euo pipefail
303+
set -eo pipefail
304+
[[ "$LIMIT" =~ ^[0-9]+$ ]] || LIMIT=250
296305
297306
STATUS_ICON="❌"
298-
if [[ "${{ steps.build.outcome }}" == "success" ]]; then
299-
STATUS_ICON="✅"
300-
fi
307+
[ "${BUILD_OUTCOME:-failure}" = "success" ] && STATUS_ICON="✅"
301308
302-
[[ "$LIMIT" =~ ^[0-9]+$ ]] || LIMIT="250"
303-
304-
if [[ "$REGISTRY" != "docker.io" && "$REPO" != "${REGISTRY}/"* ]]; then
309+
IMAGE="${REPO:-}"
310+
if [ -n "${REGISTRY:-}" ] && [ "${REGISTRY}" != "docker.io" ] && [[ "${REPO:-}" != "${REGISTRY}/"* ]]; then
305311
IMAGE="${REGISTRY}/${REPO}"
306-
else
307-
IMAGE="${REPO}"
308312
fi
309313
310314
{
311315
echo "## 🐳 Docker Build & Push ${STATUS_ICON}"
312316
echo "- **Image:** \`${IMAGE}\`"
313317
echo "- **Tags:**"
314-
echo " - \`${IMAGE}:${TAG}\`"
315-
if [[ "${PUSH_LATEST}" == "true" ]]; then
318+
echo " - \`${IMAGE}:${TAG:-latest}\`"
319+
if [ "${PUSH_LATEST:-false}" = "true" ]; then
316320
echo " - \`${IMAGE}:latest\`"
317321
fi
318-
echo "- **Platforms:** \`${PLATFORMS}\`"
319-
echo "- **Dockerfile:** \`${{ steps.ctx.outputs.context }}/${{ inputs.dockerfile_path }}\`"
320-
echo "- **Context:** \`${{ steps.ctx.outputs.context }}\`"
321-
if [[ -n "${{ steps.resolve_digest.outputs.digest || '' }}" ]]; then
322-
echo "- **Digest:** \`${{ steps.resolve_digest.outputs.digest }}\`"
323-
echo "- **Build duration:** ${{ steps.build.outputs.build_duration || 'N/A' }} seconds"
324-
echo "- **Image size:** ${{ steps.resolve_digest.outputs.image_size || 'N/A' }} bytes"
325-
echo "- **Image ref:** \`${{ steps.resolve_digest.outputs.image_ref || '' }}\`"
322+
echo "- **Platforms:** \`${PLATFORMS:-}\`"
323+
echo "- **Dockerfile:** \`${CONTEXT:-}.${DOCKERFILE_PATH:+/${DOCKERFILE_PATH}}\`"
324+
echo "- **Context:** \`${CONTEXT:-.}\`"
325+
326+
if [ -n "${DIGEST:-}" ]; then
327+
echo "- **Digest:** \`${DIGEST}\`"
328+
echo "- **Build duration:** ${BUILD_DURATION:-N/A} seconds"
329+
echo "- **Image size:** ${IMAGE_SIZE:-N/A} bytes"
330+
[ -n "${IMAGE_REF:-}" ] && echo "- **Image ref:** \`${IMAGE_REF}\`"
326331
fi
327-
if [[ "${BUILD_ARGS_JSON}" != "{}" ]]; then
328-
echo ""
332+
333+
if [ -n "${BUILD_ARGS_JSON:-}" ] && [ "${BUILD_ARGS_JSON}" != "{}" ]; then
334+
echo
329335
echo "### Build args"
330336
echo '```json'
331-
echo "${BUILD_ARGS_JSON}" | jq .
337+
if command -v jq >/dev/null 2>&1; then
338+
printf '%s\n' "${BUILD_ARGS_JSON}" | jq .
339+
else
340+
printf '%s\n' "${BUILD_ARGS_JSON}"
341+
fi
332342
echo '```'
333343
fi
334-
echo ""
335-
if [[ "${{ steps.build.outcome }}" == "success" ]]; then
344+
345+
echo
346+
if [ "${BUILD_OUTCOME:-failure}" = "success" ]; then
336347
echo "✅ **Build successful** — image pushed to registry"
337348
else
338349
echo "❌ **Build failed** — check logs for details"
339350
fi
340-
} >> "$GITHUB_STEP_SUMMARY"
351+
} >> "${GITHUB_STEP_SUMMARY:-/dev/null}" || true

0 commit comments

Comments
 (0)