//native
type Circleci = {
token: string
}
/**
* Delete a checkout key
* Deletes the checkout key via md5 or sha256 fingerprint. sha256 keys should be url-encoded.
*/
export async function main(auth: Circleci, project_slug: string, fingerprint: string) {
const url = new URL(
`https://circleci.com/api/v2/project/${project_slug}/checkout-key/${fingerprint}`
)
const response = await fetch(url, {
method: 'DELETE',
headers: {
'Circle-Token': auth.token
},
body: undefined
})
if (!response.ok) {
const text = await response.text()
throw new Error(`${response.status} ${text}`)
}
return await response.json()
}
Submitted by hugo697 536 days ago