Skip to content

Commit bffee37

Browse files
committed
ci/update: use if then else for setting cancelled step output
The simpler `[[ ]] &&` construct can exit non-zero, causing the workflow to fail.
1 parent f584d1d commit bffee37

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

.github/workflows/update.yml

+7-1
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,15 @@ jobs:
129129
(
130130
echo "old_rev=$old"
131131
echo "new_rev=$new"
132-
[[ "$old" = "$new" ]] && echo 'cancelled=1'
133132
) >> $GITHUB_OUTPUT
134133
134+
if [[ "$old" = "$new" ]]; then
135+
echo "Old and new revisions are the same"
136+
echo 'cancelled=1' >> $GITHUB_OUTPUT
137+
else
138+
echo "Old and new revisions are different"
139+
fi
140+
135141
- name: Update generated files
136142
id: generate
137143
if: (!steps.changes.outputs.cancelled) && (inputs.generate || github.event_name == 'schedule')

0 commit comments

Comments
 (0)