Skip to content

The GitHub client creates a repo from a template - #314

Merged
czpython merged 1 commit into
mainfrom
worktree-create-repo-from-template
Aug 24, 2026
Merged

czpython merged 1 commit into
mainfrom
worktree-create-repo-from-template

Conversation

@czpython

Copy link
Copy Markdown
Owner

GitHubClient.create_repo_from_template(owner, template_repo, name) generates a new private repo under owner from an owner/name GitHub template repo and returns the new repo's full_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.

  • 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.
  • No installation on owner raises GitHubAppNotInstalledError — the same typed error the repo-level lookup raises.
  • Owner-installation resolution (org, then user fallback) is now shared with list_repos_for_owner through a _owner_installation_id helper.

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.

@czpython
czpython force-pushed the worktree-create-repo-from-template branch from a50c875 to 9022e55 Compare August 23, 2026 15:57
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
czpython force-pushed the worktree-create-repo-from-template branch from 9022e55 to 3bf771f Compare August 24, 2026 05:17
@czpython
czpython merged commit 4c948a7 into main Aug 24, 2026
1 check passed
@czpython
czpython deleted the worktree-create-repo-from-template branch August 24, 2026 05:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant