Edits history of script submission #18333 for ' Get github repositories of the connected user (qovery)'

  • bun
    One script reply has been approved by the moderators
    Ap­pro­ved
    //native
    /**
     * Get github repositories of the connected user
     *
     */
    export async function main(auth: RT.Qovery) {
    	const url = new URL(`https://api.qovery.com/account/github/repository`)
    
    	const response = await fetch(url, {
    		method: 'GET',
    		headers: {
    			Authorization: 'Token ' + auth.apiKey
    		},
    		body: undefined
    	})
    	if (!response.ok) {
    		const text = await response.text()
    		throw new Error(`${response.status} ${text}`)
    	}
    	return await response.json()
    }
    

    Submitted by hugo697 235 days ago