Skip to content
This repository was archived by the owner on Nov 16, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/copy-sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,5 @@ jobs:
persist-credentials: false
- name: Tagline and cards match the org profile README
run: python3 -I scripts/check-copy.py
- name: Built site does not publish AGENTS.md or CLAUDE.md
run: python3 -I scripts/check-unpublished.py
2 changes: 1 addition & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ title: Totative
url: https://totative.dev
permalink: /writeups/:title/
include: [".well-known"]
exclude: [README.md, scripts, lefthook.yml, .gitleaks.toml, Gemfile, Gemfile.lock, vendor]
exclude: [README.md, scripts, lefthook.yml, .gitleaks.toml, Gemfile, Gemfile.lock, vendor, AGENTS.md, CLAUDE.md]
defaults:
- scope:
path: ""
Expand Down
39 changes: 39 additions & 0 deletions scripts/check-unpublished.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/usr/bin/env python3
"""Fail if AGENTS.md or CLAUDE.md would ship with the site."""

from __future__ import annotations

import re
import sys
from pathlib import Path

ROOT = Path(__file__).resolve().parents[1]
NAMES = ("AGENTS.md", "CLAUDE.md")


def excluded_paths(config: str) -> list[str]:
match = re.search(r"^exclude:\s*\[(.*)\]\s*$", config, re.M)
if match is None:
raise SystemExit("_config.yml has no exclude list")
return [
part.strip().strip("'\"") for part in match.group(1).split(",") if part.strip()
]


def main() -> int:
excluded = excluded_paths((ROOT / "_config.yml").read_text())
missing = [name for name in NAMES if name not in excluded]
if missing:
print("exclude lacks " + ", ".join(missing), file=sys.stderr)
return 1
site = ROOT / "_site"
if site.is_dir():
published = [name for name in NAMES if (site / name).is_file()]
if published:
print("_site contains " + ", ".join(published), file=sys.stderr)
return 1
return 0


if __name__ == "__main__":
raise SystemExit(main())
Loading