//native
/**
* Delete a branch
* Delete a branch from your ReadMe project.
>📘
> This route is only available to projects that are using [ReadMe Refactored](https://docs.readme.com/main/docs/welcome-to-readme-refactored).
*/
export async function main(auth: RT.Readme, branch: string) {
const url = new URL(`https://api.readme.com/v2/branches/${branch}`)
const response = await fetch(url, {
method: 'DELETE',
headers: {
Authorization: 'Bearer ' + auth.apiKey
},
body: undefined
})
if (!response.ok) {
const text = await response.text()
throw new Error(`${response.status} ${text}`)
}
return await response.text()
}
Submitted by hugo697 235 days ago