Edits history of script submission #18676 for ' Remove environment variable (render)'

  • bun
    One script reply has been approved by the moderators
    Ap­pro­ved
    //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