This is an automated email from the ASF dual-hosted git repository. gurwls223 pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/spark.git
The following commit(s) were added to refs/heads/master by this push: new aa0a5087e936 [SPARK-52717][INFRA] Escape special characters when redacting the log files in release build aa0a5087e936 is described below commit aa0a5087e936747294372bcc2b0d54ae97a64be3 Author: Hyukjin Kwon <gurwls...@apache.org> AuthorDate: Wed Jul 9 10:56:56 2025 +0900 [SPARK-52717][INFRA] Escape special characters when redacting the log files in release build ### What changes were proposed in this pull request? This PR proposes to escape special characters when redacting the log files ### Why are the changes needed? Currently it fails to redact when there are special characters. ### Does this PR introduce _any_ user-facing change? No, dev-only. ### How was this patch tested? Manually tested. ### Was this patch authored or co-authored using generative AI tooling? No. Closes #51405 from HyukjinKwon/escape-patterns. Authored-by: Hyukjin Kwon <gurwls...@apache.org> Signed-off-by: Hyukjin Kwon <gurwls...@apache.org> --- .github/workflows/release.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 024eacf5aab6..5b206f27414b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -227,9 +227,18 @@ jobs: cp "$file" "$file.bak" for pattern in "${PATTERNS[@]}"; do [ -n "$pattern" ] || continue # Skip empty patterns - escaped_pattern=$(printf '%s\n' "$pattern" | sed 's/[\/&]/\\&/g') - sed -i "s/${escaped_pattern}/***/g" "$file" + + # Safely escape special characters for sed + escaped_pattern=${pattern//\\/\\\\} # Escape backslashes + escaped_pattern=${escaped_pattern//\//\\/} # Escape forward slashes + escaped_pattern=${escaped_pattern//&/\\&} # Escape & + escaped_pattern=${escaped_pattern//$'\n'/} # Remove newlines + escaped_pattern=${escaped_pattern//$'\r'/} # Remove carriage returns (optional) + + # Redact the pattern + sed -i.bak "s/${escaped_pattern}/***/g" "$file" done + rm -f "$file.bak" done # Zip logs/output --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org For additional commands, e-mail: commits-h...@spark.apache.org