ci: Make filter script less error-prone (#49670)

Piotr Osiewicz and Marshall Bowers created

The failure in #49661 was caused by a broken pipe, which then led to
tests not being ran.

Co-authored-by: Marshall Bowers <marshall@zed.dev>

Before you mark this PR as ready for review, make sure that you have:
- [ ] Added a solid test coverage and/or screenshots from doing manual
testing
- [ ] Done a self-review taking into account security and performance
aspects
- [ ] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)

Release Notes:

- N/A

Co-authored-by: Marshall Bowers <marshall@zed.dev>

Change summary

.github/workflows/extension_tests.yml          | 1 +
.github/workflows/run_tests.yml                | 1 +
tooling/xtask/src/tasks/workflows/run_tests.rs | 1 +
3 files changed, 3 insertions(+)

Detailed changes

.github/workflows/extension_tests.yml 🔗

@@ -23,6 +23,7 @@ jobs:
     - id: filter
       name: filter
       run: |
+        set -euo pipefail
         if [ -z "$GITHUB_BASE_REF" ]; then
           echo "Not in a PR context (i.e., push to main/stable/preview)"
           COMPARE_REV="$(git rev-parse HEAD~1)"

.github/workflows/run_tests.yml 🔗

@@ -26,6 +26,7 @@ jobs:
     - id: filter
       name: filter
       run: |
+        set -euo pipefail
         if [ -z "$GITHUB_BASE_REF" ]; then
           echo "Not in a PR context (i.e., push to main/stable/preview)"
           COMPARE_REV="$(git rev-parse HEAD~1)"

tooling/xtask/src/tasks/workflows/run_tests.rs 🔗

@@ -105,6 +105,7 @@ fn orchestrate_impl(rules: &[&PathCondition], include_package_filter: bool) -> N
     let mut script = String::new();
 
     script.push_str(indoc::indoc! {r#"
+        set -euo pipefail
         if [ -z "$GITHUB_BASE_REF" ]; then
           echo "Not in a PR context (i.e., push to main/stable/preview)"
           COMPARE_REV="$(git rev-parse HEAD~1)"