This is an automated email from the ASF dual-hosted git repository.
potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow-site.git
The following commit(s) were added to refs/heads/main by this push:
new bec8ede1fe Better watermark diagnostics
bec8ede1fe is described below
commit bec8ede1fe870de25894bfdc6e4a771711f46cb0
Author: Jarek Potiuk <[email protected]>
AuthorDate: Thu May 15 05:48:01 2025 -0400
Better watermark diagnostics
---
.github/scripts/add_watermark.py | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/.github/scripts/add_watermark.py b/.github/scripts/add_watermark.py
index 0ae4ddff1b..8b9b794cb6 100755
--- a/.github/scripts/add_watermark.py
+++ b/.github/scripts/add_watermark.py
@@ -71,14 +71,16 @@ if __name__ == "__main__":
content_to_add = CSS_TO_ADD.replace("URL_PREFIX", url_prefix)
console.print(f"[bright_blue]Looking for css files following '{pattern}'
pattern[/] in {folder_path}")
files = folder_path.rglob(pattern)
- for file in files:
- content = file.read_text()
- if not "watermark semi-transparent" in content:
- console.print(f"[yellow]Adding watermark to:[/] {file}")
- content = content + content_to_add
- file.write_text(content)
+ if not files:
+ console.print(f"[red]No files found with pattern {pattern} in
{folder_path}")
else:
- console.print("[red]Not found files to update css in.")
+ for file in files:
+ content = file.read_text()
+ if not "watermark semi-transparent" in content:
+ console.print(f"[yellow]Adding watermark to:[/] {file}")
+ content = content + content_to_add
+ file.write_text(content)
target_image_location = folder_path / image_directory_path
+ console.print(f"[yellow]Creating staging image at
:[/]:{target_image_location}/staging.png")
target_image_location.mkdir(parents=True, exist_ok=True)
shutil.copy(IMAGE_FILE, target_image_location / "staging.png")