Skip to content
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
12 changes: 8 additions & 4 deletions .github/workflows/branch-policy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ jobs:
}
is_mac_bootstrap() {
[[ "$1" == flake.nix || "$1" == flake.lock \
|| "$1" == nix/* || "$1" == hosts/* ]]
|| "$1" == nix/* || "$1" == hosts/* \
|| "$1" == .github/actions/mac-nix-setup/* ]]
}
is_linux_container_setup() {
[[ "$1" == .github/actions/linux-container-setup/* ]]
}

case "$branch" in
Expand Down Expand Up @@ -64,16 +68,16 @@ jobs:
bootstrap/mac)
for f in "${files[@]}"; do
if ! is_mac_bootstrap "$f" && ! is_doc "$f"; then
echo "bootstrap/mac must only touch flake.nix, flake.lock, nix/**, hosts/**, or *.md/*.org: $f" >&2
echo "bootstrap/mac must only touch flake.nix, flake.lock, nix/**, hosts/**, .github/actions/mac-nix-setup/**, or *.md/*.org: $f" >&2
exit 1
fi
done
;;
bootstrap/*)
distro="${branch#bootstrap/}"
for f in "${files[@]}"; do
if [[ "$f" != "os-init/${distro}-init.sh" ]] && ! is_doc "$f"; then
echo "bootstrap/${distro} must only touch os-init/${distro}-init.sh or *.md/*.org: $f" >&2
if [[ "$f" != "os-init/${distro}-init.sh" ]] && ! is_linux_container_setup "$f" && ! is_doc "$f"; then
echo "bootstrap/${distro} must only touch os-init/${distro}-init.sh, .github/actions/linux-container-setup/**, or *.md/*.org: $f" >&2
exit 1
fi
done
Expand Down
4 changes: 2 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ Common types: `feat`, `fix`, `chore`, `refactor`, `docs`, `style`, `test`.
To protect `master`, follow these rules:

- When developing any OS-specific bootstrap, check out to a `bootstrap/<name>` branch (e.g., `bootstrap/ubuntu`). Long-lived. Scope is restricted by `branch-policy`:
- `bootstrap/<distro>` (where `<distro>` is `ubuntu`, `debian`, `fedora`, `opensuse-tumbleweed`, or `cachyos`): only `os-init/<distro>-init.sh` (plus `*.md`/`*.org`).
- `bootstrap/mac`: only `flake.nix`, `flake.lock`, `nix/**`, `hosts/**` (plus `*.md`/`*.org`).
- `bootstrap/<distro>` (where `<distro>` is `ubuntu`, `debian`, `fedora`, `opensuse-tumbleweed`, or `cachyos`): only `os-init/<distro>-init.sh` and `.github/actions/linux-container-setup/**` (plus `*.md`/`*.org`).
- `bootstrap/mac`: only `flake.nix`, `flake.lock`, `nix/**`, `hosts/**`, and `.github/actions/mac-nix-setup/**` (plus `*.md`/`*.org`).
- `bootstrap/shared`: only `init.sh` and `scripts/shell-init.sh` (plus `*.md`/`*.org`). This is the only bootstrap branch whose PR triggers the full `bootstrap.yml` matrix — use it for edits that affect bootstrap across all distros.
- When developing any recipe, check out to a `dev/<name>` branch (e.g., `dev/zsh`). Long-lived.
- When writing or updating documentation, check out to a `docs/<name>` branch (e.g., `docs/readme`) to avoid merge conflicts with parallel code work. Short-lived. Only `*.md` and `*.org` files may change.
Expand Down
Loading