From cd1755c151f10935d9abe6d257b8e9cbb5ee8204 Mon Sep 17 00:00:00 2001 From: Foivos Proestakis Date: Sun, 20 Oct 2024 19:31:39 +0000 Subject: [PATCH] test for ci/cd --- db/blockly_unix_database.db | Bin 299008 -> 307200 bytes server.js | 20 ++++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/db/blockly_unix_database.db b/db/blockly_unix_database.db index f68ba3fea822ddd915970f66edd600441ec90f0e..0cb96db34fbf39611db4fd801c2e0d6cb7e65b76 100644 GIT binary patch delta 3244 zcmeH}No*U}8OLX#L@8P*S(JBM)HsAliIiqIGo(0*sy*5)k)oDpfw&Kc6n73OnWCx0 zRAQ%S5l|i#FEI=>PSX}B(lmmKvPIn%KE+O33cdtrivmF}Z2=$ZOAa{{ePpZJu4M!+ z&{H#*c^J&R?|aMl{eRzk?cHOqeReE=x>8<&Ajss7>T8(1V$b=$qE=R)Mie&`bp5aE z)BBALf%;diGC5*uV-cDnjoq|~H8JoeSrbWjcN>kvyciH7sxjWR&PTkW5b>Aa`h~D7 z5bE?q!v@m8=qXZfAXOC0u{6AWIP_>SLywe+HZT-RnrJgg(==r!O-%7S#UB-K7k_n- zQx$iLKkX^*6@O9OJJ>G%48HxiSUAXufpAoGCH<}lNk3~K(#Vl!iEg=HD^qMEifzTu z72i_)VZTu&Dqd>D+t4TGEmPwb^gqUZdRV*#A3~*>mNU}tyV{}KT|}{~xU2Y!;)l@f z>k8&1&Z0-{fb2AGMvtB|zJIr`ssR{tW zg8veG0IJ@_&%&s_g%*Bt3pb*&E7Lg(aD9k>0%mvcPYe0?@nlUyrR;O0@`mj5`qMSP zlYb#UfCfEi^_yEcuN>LwLBT@~Wu%Wjs8NPAy_Y&Kg#_ntpUt8lcYE~?GiW_4J9quN z$EEu3)q%g|v0i1Y-s}BB7su%3cyPSmWdP_s+^F1~S(@t#r3|f^*=(0V-!p6* zv;zGBeiH2kH-CfcK>i-ytehb=x&>~%ebw#^n=Ws>Vp5Y^QhfK+i9UxX8I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Sh?lj6R~{tKw# z4g2 { next(); }); +app.post('/github-webhook', (req, res) => { + const githubSignature = req.headers['x-hub-signature-256']; + if (req.body.ref === 'refs/heads/main') { + exec('cd /blockly && git pull origin main', (err, stdout, stderr) => { + if (err) { + console.error(`Error executing git pull: ${stderr}`); + return res.sendStatus(500); + } + console.log(`Git pull output: ${stdout}`); + return res.sendStatus(200); + }); + } else { + res.sendStatus(200); + } +}); + +app.listen(4000, () => { + console.log('Listening for GitHub Webhooks on port 4000'); +}); // Middleware to add auth token function addAuthToken(req, res, next) { if (req.isAuthenticated()) {