From bffee37f57dc6e3b04ed574f8dc2aaf9dc9769b8 Mon Sep 17 00:00:00 2001 From: Matt Sturgeon Date: Thu, 30 Jan 2025 15:57:24 +0000 Subject: [PATCH] ci/update: use `if then else` for setting `cancelled` step output The simpler `[[ ]] &&` construct can exit non-zero, causing the workflow to fail. --- .github/workflows/update.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml index 9c671755..7b41b784 100644 --- a/.github/workflows/update.yml +++ b/.github/workflows/update.yml @@ -129,9 +129,15 @@ jobs: ( echo "old_rev=$old" echo "new_rev=$new" - [[ "$old" = "$new" ]] && echo 'cancelled=1' ) >> $GITHUB_OUTPUT + if [[ "$old" = "$new" ]]; then + echo "Old and new revisions are the same" + echo 'cancelled=1' >> $GITHUB_OUTPUT + else + echo "Old and new revisions are different" + fi + - name: Update generated files id: generate if: (!steps.changes.outputs.cancelled) && (inputs.generate || github.event_name == 'schedule')