Merge pull request #10639: [BEAM-8939] Report status code 0 when no stale jobs are found

diff --git a/.test-infra/tools/stale_dataflow_jobs_cleaner.sh b/.test-infra/tools/stale_dataflow_jobs_cleaner.sh
index 66bf880..e563048 100755
--- a/.test-infra/tools/stale_dataflow_jobs_cleaner.sh
+++ b/.test-infra/tools/stale_dataflow_jobs_cleaner.sh
@@ -19,5 +19,11 @@
 #
 set -euo pipefail
 
-gcloud dataflow jobs list --created-before=-P3H --format='value(JOB_ID)' \
---status=active --region=us-central1 | xargs gcloud dataflow jobs cancel
+STALE_JOBS=$(gcloud dataflow jobs list --created-before=-P3H \
+--format='value(JOB_ID)' --status=active --region=us-central1)
+
+if [[ ${STALE_JOBS} ]]; then
+  gcloud dataflow jobs cancel --region=us-central1 ${STALE_JOBS}
+else
+  echo "No stale jobs found."
+fi