//native
type Render = {
apiKey: string
}
/**
* Remove environment variable
* Remove a particular environment variable from a particular environment group.
*/
export async function main(auth: Render, envGroupId: string, envVarKey: string) {
const url = new URL(`https://api.render.com/v1/env-groups/${envGroupId}/env-vars/${envVarKey}`)
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