Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/export-dynamic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
36 changes: 20 additions & 16 deletions export-dynamic/export-dynamic.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
Expand All @@ -176,21 +178,23 @@ do
echo "$image" >> "$PUBLISHED_EXPORTS_OUTPUT"
done

# shellcheck disable=SC2129 disable=SC2086
if [[ "$GITHUB_OUTPUT" != "" ]]
then
echo "FAILED_EXPORTS<<EOF" >> $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<<EOF" >> $GITHUB_OUTPUT
cat $PUBLISHED_EXPORTS_OUTPUT >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
echo "FAILED_EXPORTS<<EOF" | tee -a "$GITHUB_OUTPUT"
cat "$FAILED_EXPORTS_OUTPUT" | tee -a "$GITHUB_OUTPUT"
echo "EOF" | tee -a "$GITHUB_OUTPUT"

if [[ "${skipWorkspace}" == "true" ]]
then
echo "WORKSPACE_SKIPPED_UNCHANGED_SINCE=${INPUTS_LAST_PUBLISH_COMMIT}" >> $GITHUB_OUTPUT
else
echo "WORKSPACE_SKIPPED_UNCHANGED_SINCE=false" >> $GITHUB_OUTPUT
fi
echo "PUBLISHED_EXPORTS<<EOF" | tee -a "$GITHUB_OUTPUT"
cat "$PUBLISHED_EXPORTS_OUTPUT" | tee -a "$GITHUB_OUTPUT"
echo "EOF" | tee -a "$GITHUB_OUTPUT"

if [[ "${skipWorkspace}" == "true" ]]
then
echo "WORKSPACE_SKIPPED_UNCHANGED_SINCE=${INPUTS_LAST_PUBLISH_COMMIT}" | tee -a "$GITHUB_OUTPUT"
else
echo "WORKSPACE_SKIPPED_UNCHANGED_SINCE=false" | tee -a "$GITHUB_OUTPUT"
fi

# exit a return code equivalent to the number of errors
exit $((${#errors[@]}))