diff --git a/.github/workflows/export-dynamic.yaml b/.github/workflows/export-dynamic.yaml index 335bce6..52e3817 100644 --- a/.github/workflows/export-dynamic.yaml +++ b/.github/workflows/export-dynamic.yaml @@ -286,6 +286,9 @@ jobs: image-repository-prefix: ${{ steps.set-image-tag-name.outputs.IMAGE_REPOSITORY_PREFIX }} image-tag-prefix: ${{ inputs.image-tag-prefix }} last-publish-commit: ${{ inputs.last-publish-commit }} + run: + # for now always pass this step so we can get all the followup logging steps to still run even if the export fails + ${{ github.action_path }}/export-dynamic.sh || true - name: Set artifacts name suffix id: set-artifacts-name-suffix diff --git a/export-dynamic/export-dynamic.sh b/export-dynamic/export-dynamic.sh index 0540ee8..4885bfa 100755 --- a/export-dynamic/export-dynamic.sh +++ b/export-dynamic/export-dynamic.sh @@ -159,7 +159,9 @@ else set -e popd > /dev/null done < "${INPUTS_PLUGINS_FILE}" - echo "Plugins with failed exports: ${errors[*]}" + if [[ ${#errors[@]} -gt 0 ]]; then + echo "Plugins with failed exports: ${errors[*]}" + fi fi FAILED_EXPORTS_OUTPUT=${FAILED_EXPORTS_OUTPUT:-"failed-exports-output"} @@ -176,21 +178,23 @@ do echo "$image" >> "$PUBLISHED_EXPORTS_OUTPUT" done -# shellcheck disable=SC2129 disable=SC2086 -if [[ "$GITHUB_OUTPUT" != "" ]] -then - echo "FAILED_EXPORTS<> $GITHUB_OUTPUT - cat $FAILED_EXPORTS_OUTPUT >> $GITHUB_OUTPUT - echo "EOF" >> $GITHUB_OUTPUT +# write to a temp file if the GITHUB_OUTPUT pipe isn't set +if [[ ! $GITHUB_OUTPUT ]]; then GITHUB_OUTPUT=/tmp/github_output.txt; fi - echo "PUBLISHED_EXPORTS<> $GITHUB_OUTPUT - cat $PUBLISHED_EXPORTS_OUTPUT >> $GITHUB_OUTPUT - echo "EOF" >> $GITHUB_OUTPUT +echo "FAILED_EXPORTS<> $GITHUB_OUTPUT - else - echo "WORKSPACE_SKIPPED_UNCHANGED_SINCE=false" >> $GITHUB_OUTPUT - fi +echo "PUBLISHED_EXPORTS<