diff --git a/GitForWindowsHelper/index.js b/GitForWindowsHelper/index.js index 9bcc79a0..d785e31d 100644 --- a/GitForWindowsHelper/index.js +++ b/GitForWindowsHelper/index.js @@ -1,8 +1,5 @@ const validateGitHubWebHook = require('./validate-github-webhook') -/** Sends a JWT-authenticated GitHub API request */ -const gitHubApiRequestAsApp = require('./github-api-request-as-app') - module.exports = async function (context, req) { const withStatus = (status, headers, body) => { context.res = { @@ -23,22 +20,6 @@ module.exports = async function (context, req) { return withStatus(403, undefined, `Go away, you are not a valid GitHub webhook: ${e}`) } - if (req.headers['x-github-event'] === 'installation' && req.body.action === 'created') { - try { - const res = await gitHubApiRequestAsApp(context, 'DELETE', `/app/installations/${req.body.installation.id}`) - context.log(`Deleted installation ${req.body.installation.id} on ${req.body.repositories.map(e => e.full_name).join(", ")}`) - context.log(res) - context.res = { - status: 200, - body: `Deleted installation`, - } - } catch (e) { - context.log(e) - return withStatus(500, undefined, `Error:\n${e}`) - } - return - } - context.log("Got headers") context.log(req.headers) context.log("Got body")