From 0c784ab68e6e216670c6e6999534008ec068278f Mon Sep 17 00:00:00 2001 From: Sebastian Seedorf Date: Wed, 26 Jan 2022 02:30:44 +0100 Subject: [PATCH] Cleanup --- src/index.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/index.ts b/src/index.ts index 5384d11..8087f9a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -3,7 +3,6 @@ import 'dotenv/config' import * as env from 'env-var' import { PushWebhook } from "./PushWebhook"; import { exec } from "child_process"; -import { promisify } from "util"; const app: Application = express() @@ -29,11 +28,10 @@ async function parsePushHook(webhook: PushWebhook) { .replace(/\//gi, '_') const safeTag = tag .replace(/[^a-z0-9-]/gi, '') - const safeResourceUri = tag + const safeResourceUri = resource_url .replace(/[^a-z0-9-./:]/gi, '') try { const cmd = `${rootDir}/${safeFilename}.sh ${safeTag} ${safeResourceUri}` - console.log(cmd) await new Promise(((resolve, reject) => { exec(cmd, (err, stdout, stderr) => (err || stderr) ? reject(err || stderr) : resolve(stdout) @@ -51,7 +49,6 @@ app.post('/', async (req: Request, res: Response) => { return } const body: PushWebhook = req.body - console.log(JSON.stringify(body, null, 2)) if (body?.type !== "PUSH_ARTIFACT") { res.status(400).json({msg: "Only push hooks are allowed!"}) return