File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -138,8 +138,15 @@ jobs:
138138 SCRIPT_OUTPUT=$(./scripts/packages/check-copr-versions.sh $CHANGED_PKGS 2>&1)
139139 echo "$SCRIPT_OUTPUT"
140140
141- # Extract packages that need building from the script output
142- NEEDS_BUILD=$(echo "$SCRIPT_OUTPUT" | grep "^NEEDS_BUILD_JSON=" | sed 's/^NEEDS_BUILD_JSON=//' | jq -r '.[]' | tr '\n' ' ')
141+ # Extract packages that need building from the script output.
142+ # `grep` exits 1 when nothing matches (all packages up to date);
143+ # tolerate that so set -o pipefail doesn't kill the step.
144+ JSON_LINE=$(echo "$SCRIPT_OUTPUT" | grep "^NEEDS_BUILD_JSON=" || true)
145+ if [[ -n "$JSON_LINE" ]]; then
146+ NEEDS_BUILD=$(echo "$JSON_LINE" | sed 's/^NEEDS_BUILD_JSON=//' | jq -r '.[]' | tr '\n' ' ')
147+ else
148+ NEEDS_BUILD=""
149+ fi
143150 fi
144151
145152 echo ""
You can’t perform that action at this time.
0 commit comments