provider codespaces POST /user/codespaces/{codespace_name}/publish
@utdk/github /user/codespaces/{codespace_name}/publish
Create a repository from an unpublished codespace
Publishes an unpublished codespace, creating a new repository and assigning it to the codespace. The codespace's token is granted write permissions to the repository, allowing the user to push their changes. This will fail for a codespace that is already published, meaning it has an associated repository. OAuth app tokens and personal access tokens (classic) need the `codespace` scope to use this endpoint.
codespace_name path required
The name of the codespace.
string

Try it

Authentication
Configure credentials for GitHub v3 REST API
codespaces.publishForAuthenticatedUser
POST/user/codespaces/{codespace_name}/publish
Publishes an unpublished codespace, creating a new repository and assigning it to the codespace. The codespace's token is granted write permissions to the repository, allowing the user to push their changes. This will fail for a codespace that is already published, meaning it has an associated repository. OAuth app tokens and personal access tokens (classic) need the `codespace` scope to use this endpoint.

Parameters

required

The name of the codespace.

Input

A name for the new repository.

Whether the new repository should be private.

Configure credentials above to enable sending.

Code snippet
Updates live as you fill in the form above.

TypeScript

import github from '@utdk/github';

await github.codespaces.publishForAuthenticatedUser({
  "private": false
})