The GitHub client creates a repo from a template - #314
Merged
Merged
Conversation
czpython
force-pushed
the
worktree-create-repo-from-template
branch
from
August 23, 2026 15:57
a50c875 to
9022e55
Compare
Adds GitHubClient.create_repo_from_template(owner, template_repo, name): generate a new private repo under owner from an owner/name template repo, returning the new repo's full_name. Repos are private — the site is served via Cloudflare, not the repo. A 422 for a name already taken under owner returns the full_name, so a retry after a partial failure is idempotent rather than raising. A missing installation on owner raises GitHubAppNotInstalledError, the same typed error the repo-level lookup raises. Owner-installation resolution (org, then user) is shared with list_repos_for_owner via a _owner_installation_id helper. Creating a repo needs the GitHub App to hold Administration: write on the target org, in addition to its existing Contents and Metadata access.
czpython
force-pushed
the
worktree-create-repo-from-template
branch
from
August 24, 2026 05:17
9022e55 to
3bf771f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GitHubClient.create_repo_from_template(owner, template_repo, name)generates a new private repo underownerfrom anowner/nameGitHub template repo and returns the new repo'sfull_name. This is what an app needs to make one repo per unit of work — the site_builder app creates one repo per shop. Repos are private because the site is served via Cloudflare, not the repo.422for a name already taken underownerreturns thefull_name, so a retry after a partial failure is idempotent rather than raising.ownerraisesGitHubAppNotInstalledError— the same typed error the repo-level lookup raises.list_repos_for_ownerthrough a_owner_installation_idhelper.Setup: creating a repo needs the GitHub App to hold Administration: write on the target org, on top of its existing Contents and Metadata access.