fix: branch
This commit is contained in:
@@ -26,8 +26,7 @@ fastify.post(
|
|||||||
async (request, reply) => {
|
async (request, reply) => {
|
||||||
try {
|
try {
|
||||||
const {
|
const {
|
||||||
ref,
|
repository: { clone_url: repoUrl, default_branch: branch },
|
||||||
repository: { clone_url: repoUrl },
|
|
||||||
} = request.body;
|
} = request.body;
|
||||||
|
|
||||||
const { code } = await execAsync("git rev-parse --git-dir")
|
const { code } = await execAsync("git rev-parse --git-dir")
|
||||||
@@ -44,8 +43,8 @@ fastify.post(
|
|||||||
// we won't be able to reply later, so do it here
|
// we won't be able to reply later, so do it here
|
||||||
// this doesn't necessarily imply a successful build though
|
// this doesn't necessarily imply a successful build though
|
||||||
// TODO: healthcheck
|
// TODO: healthcheck
|
||||||
reply.status(200).send("Updated successfully");
|
reply.status(200).send("fetched successfully");
|
||||||
await execAsync(`git reset --hard ${ref}`);
|
await execAsync(`git reset --hard origin/${branch}`);
|
||||||
await execAsync("npm run build");
|
await execAsync("npm run build");
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
reply.status(500).send("Update failed");
|
reply.status(500).send("Update failed");
|
||||||
|
|||||||
Reference in New Issue
Block a user