From 48e6e8538dd2d6d7cf76a17ab971b117705ce0b5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 12 Feb 2026 17:43:37 +0000 Subject: [PATCH] Fix EOF handling in bash read and improve empty content detection Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com> --- .github/workflows/nightly.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index be467bf3e..d38bbd561 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -721,8 +721,8 @@ jobs: with open("release_files.txt", "rb") as f: content = f.read() - # Handle empty file case explicitly - if content.rstrip(b"\0"): + # Handle empty file case - check if there's meaningful content after removing NULs + if content.strip(b"\0"): # Strip trailing NUL before splitting to avoid empty trailing element files = content.decode("utf-8").rstrip("\0").split("\0") @@ -748,7 +748,8 @@ jobs: # Only if the deduplicated file list is not empty if [ -s release_files_dedup.txt ]; then declare -a FILES - while IFS= read -r -d $'\0' file; do + # Handle the case where read returns non-zero at EOF after successfully reading last entry + while IFS= read -r -d $'\0' file || [ -n "$file" ]; do FILES+=("$file") done < release_files_dedup.txt