From 166f1bd93aaca214f0752d668f5ef7cad9d525ca Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Mon, 2 Aug 2021 16:46:47 +0100 Subject: [PATCH 1/4] Fix the `tests-done` github actions step, again Try forcing a fail by setting the exit code --- .github/workflows/tests.yml | 3 +++ changelog.d/10512.misc | 1 + 2 files changed, 4 insertions(+) create mode 100644 changelog.d/10512.misc diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0a62c62d02c3..b8fa56701378 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -370,10 +370,13 @@ jobs: # the `jq` incantation dumps out a series of " " lines run: | set -o pipefail + rc=0 jq -r 'to_entries[] | [.key,.value.result] | join(" ")' \ <<< $NEEDS_CONTEXT | while read job result; do if [ "$result" != "success" ]; then echo "::set-failed ::Job $job returned $result" + rc=1 fi done + exit $rc diff --git a/changelog.d/10512.misc b/changelog.d/10512.misc new file mode 100644 index 000000000000..c012e89f4bbb --- /dev/null +++ b/changelog.d/10512.misc @@ -0,0 +1 @@ +Update the `tests-done` Github Actions status. From e674a15f65568f7f0ac3eede2acfc272dda76b3d Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Mon, 2 Aug 2021 17:09:51 +0100 Subject: [PATCH 2/4] rewrite it again --- .github/workflows/tests.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b8fa56701378..239553ae138e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -367,16 +367,16 @@ jobs: - name: Set build result env: NEEDS_CONTEXT: ${{ toJSON(needs) }} - # the `jq` incantation dumps out a series of " " lines + # the `jq` incantation dumps out a series of " " lines. + # we set it to an intermediate variable to avoid a pipe, which makes it + # hard to set $rc. run: | - set -o pipefail rc=0 - jq -r 'to_entries[] | [.key,.value.result] | join(" ")' \ - <<< $NEEDS_CONTEXT | - while read job result; do - if [ "$result" != "success" ]; then - echo "::set-failed ::Job $job returned $result" - rc=1 - fi - done + results=$(jq -r 'to_entries[] | [.key,.value.result] | join(" ")' <<< $NEEDS_CONTEXT) + while read job result ; do + if [ "$result" != "success" ]; then + echo "::set-failed ::Job $job returned $result" + rc=1 + fi + done <<< $results exit $rc From fb26d15019070ea344b71e3af005ffc28e6b8ee0 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Mon, 2 Aug 2021 17:26:05 +0100 Subject: [PATCH 3/4] break lint, to test --- changelog.d/10512.misc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.d/10512.misc b/changelog.d/10512.misc index c012e89f4bbb..e0d9191d69f0 100644 --- a/changelog.d/10512.misc +++ b/changelog.d/10512.misc @@ -1 +1 @@ -Update the `tests-done` Github Actions status. +Update the `tests-done` Github Actions status From 8fd379106e70373870cb354e78ed8ed4fdfcea62 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Mon, 2 Aug 2021 17:40:25 +0100 Subject: [PATCH 4/4] Revert "break lint, to test" This reverts commit fb26d15019070ea344b71e3af005ffc28e6b8ee0. --- changelog.d/10512.misc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.d/10512.misc b/changelog.d/10512.misc index e0d9191d69f0..c012e89f4bbb 100644 --- a/changelog.d/10512.misc +++ b/changelog.d/10512.misc @@ -1 +1 @@ -Update the `tests-done` Github Actions status +Update the `tests-done` Github Actions status.