From ba94009822cdfe6afcab54fb2f51b18d594799a6 Mon Sep 17 00:00:00 2001 From: moilanik Date: Sun, 14 Jun 2026 08:17:50 +0300 Subject: [PATCH] fix: propagate docker exit code from bats pipeline with pipefail Pipeline 'tar | docker | tee' previously always returned tee's exit code (0), masking test failures in the bats job. set -o pipefail makes 0 capture the last failed command's exit code instead. --- .gitea/workflows/quality-gate.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/quality-gate.yml b/.gitea/workflows/quality-gate.yml index dc17fc6..720b9a6 100644 --- a/.gitea/workflows/quality-gate.yml +++ b/.gitea/workflows/quality-gate.yml @@ -50,6 +50,7 @@ jobs: shell: bash run: | set +e + set -o pipefail mkdir -p "reports/${GITHUB_SHA:0:8}/bats" tar cf - . | docker run --rm -i \ --entrypoint bash ${{ inputs.bats-image }} \ @@ -60,7 +61,7 @@ jobs: apk add -q lsof python3 jq curl ruby bats tests/ ' 2>&1 | tee "reports/${GITHUB_SHA:0:8}/bats/results.txt" - BATS_EXIT=${PIPESTATUS[1]} + BATS_EXIT=$? bash .ci/.gitea/scripts/bats-report.sh "reports/${GITHUB_SHA:0:8}/bats" || true STATE="success"