// module 03 · Enforcement developers can't turn off
A baseline ruleset on every repo, put back when it drifts
On GitHub Free there are no org rulesets, so you copy one repo ruleset to every repo with a script and check the copies with another. This lesson builds both: `apply-baseline.sh` creates or updates the ruleset by name, and `check-drift.sh` finds repos where it was deleted, disabled or loosened, and puts it back. Then you watch the baseline reject a direct push to `main` from the org owner.
Learning Objectives
- Write a baseline ruleset for the default branch that one person can still work under
- Apply one ruleset to every repo in an org, safely rerunnable, with create-or-update by name
- Detect a deleted, disabled or loosened ruleset by comparing each repo with the file
- Restore drifted repos automatically and say what that does not fix
- Show the ruleset blocking a direct push, a force push and a branch deletion
This lesson is for enrolled learners
Log in, then enroll to read the full lesson, run its lab and take the quiz.
