From c05c314cc7f6034f4aa3d87788e77580db5ebc47 Mon Sep 17 00:00:00 2001 From: Nick Boldt Date: Wed, 17 Dec 2025 14:59:56 -0400 Subject: [PATCH 1/3] chore: improve logic: don't imply failures if there are none; don't pass the build if there are failures (RHIDP-9067) Signed-off-by: Nick Boldt --- export-dynamic/export-dynamic.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/export-dynamic/export-dynamic.sh b/export-dynamic/export-dynamic.sh index 0540ee8..ed7496c 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"} @@ -194,3 +196,6 @@ then echo "WORKSPACE_SKIPPED_UNCHANGED_SINCE=false" >> $GITHUB_OUTPUT fi fi + +# exit a return code equivalent to the number of errors +exit $((${#errors[@]})) \ No newline at end of file From 016f5fc75fc94fd6b0ec2d51109b928af2c76ab9 Mon Sep 17 00:00:00 2001 From: Nick Boldt Date: Wed, 17 Dec 2025 17:54:57 -0400 Subject: [PATCH 2/3] tee to GITHUB_OUTPUT (which can fall back to a local temp file) so we get console output even if the script fails Signed-off-by: Nick Boldt --- export-dynamic/export-dynamic.sh | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/export-dynamic/export-dynamic.sh b/export-dynamic/export-dynamic.sh index ed7496c..4885bfa 100755 --- a/export-dynamic/export-dynamic.sh +++ b/export-dynamic/export-dynamic.sh @@ -178,24 +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< Date: Thu, 18 Dec 2025 12:57:33 -0400 Subject: [PATCH 3/3] for now always pass the export-dynamic.sh step, so we can get all the followup logging steps to still run even if the export fails Signed-off-by: Nick Boldt --- .github/workflows/export-dynamic.yaml | 3 +++ 1 file changed, 3 insertions(+) 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