Docs are less likely to be broken if GitHub implements some automated, global way to rename the main branch: when this isn't done in an ad-hoc, per-repo way, they can implement logic to redirect URLs.
(Or, for a quick and dirty fix, always redirect master to the main branch)
(Or, for a quick and dirty fix, always redirect master to the main branch)