Skip to content

Commit 4fe8fb4

Browse files
committed
upd anon flow
1 parent 835ecf9 commit 4fe8fb4

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

.github/scripts/anonymize.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,32 @@ def should_skip(path: Path) -> bool:
3030
return any(part in SKIP_PATHS for part in path.parts)
3131

3232

33+
ANON_SECTION = """
34+
---
35+
36+
**Anonymous versions for review:**
37+
38+
| Artifact | Link |
39+
|---|---|
40+
| 📦 Repository | [anonymous.4open.science/r/Aiice-0BF8](https://anonymous.4open.science/r/Aiice-0BF8) |
41+
| 📖 Documentation | [prismatic-baklava-6691d5.netlify.app](https://prismatic-baklava-6691d5.netlify.app) |
42+
| 🗄️ Dataset | [huggingface.co/datasets/anon-aiice/Aiice](https://huggingface.co/datasets/anon-aiice/Aiice) |
43+
"""
44+
45+
46+
def inject_anon_section(root: str = ".") -> None:
47+
readme = Path(root) / "README.md"
48+
if not readme.exists():
49+
print(" [!] README.md not found, skipping anon section injection")
50+
return
51+
content = readme.read_text(encoding="utf-8")
52+
if "Anonymous versions for review" in content:
53+
print(" [~] README.md already has anon section, skipping")
54+
return
55+
readme.write_text(content + ANON_SECTION, encoding="utf-8")
56+
print(" [+] Injected anon section into README.md")
57+
58+
3359
def anonymize_file(path: Path) -> int:
3460
"""Replace all sensitive strings in a single file. Returns number of replacements."""
3561
try:
@@ -67,6 +93,7 @@ def anonymize_repo(root: str = ".") -> None:
6793
total_replacements += replacements
6894

6995
print(f"\nDone: {total_replacements} replacements across {total_files} files.")
96+
inject_anon_section(root)
7097

7198

7299
if __name__ == "__main__":

0 commit comments

Comments
 (0)