Skip to content

Commit b965f0d

Browse files
committed
Force command inside series of piped commands to fail
1 parent 8258b24 commit b965f0d

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

.github/workflows/decide-to-run-integration-tests.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ jobs:
4646
shopt -s inherit_errexit
4747
4848
# '|| true' required since grep returns non-zero status code when no matches are found
49-
num_files_changed=$(git diff "origin/$EARLIER_REV..origin/$LATER_REV" --name-only | \
49+
files_changed=$(git diff "origin/$EARLIER_REV..origin/$LATER_REV" --name-only)
50+
num_files_changed=$(echo "$files_changed" | \
5051
grep --invert-match --count \
5152
-e "^doc/" \
5253
-e "^aerospike-stubs/" \
@@ -71,4 +72,4 @@ jobs:
7172
# Fail if we can't find a tag for the later revision
7273
echo "later_rev_tag=$(git describe --tags --exact-match "origin/$LATER_REV")" >> "$GITHUB_OUTPUT"
7374
# We want this step to fail if a command failed while using pipes
74-
shell: bash -ex {0}
75+
shell: bash -exo pipefail {0}

0 commit comments

Comments
 (0)