INNER CODE UNIT · JavaScript

removeWebhook

alohe/quicky · index.js:699

async function removeWebhook(repo, webhookId) {
	const config = readConfig();
	try {
		await axios.delete(
			`https://api.github.com/repos/${repo}/hooks/${webhookId}`,
			{
				headers: {
					Authorization: `Bearer ${config.github.access_token}`,
				},
			},
		);
		console.log(`Webhook ${webhookId} removed.`);
		return true;
	} catch (error) {
		console.error(`Error removing webhook: ${error.message}`);
		return false;
	}
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…