Fix checkout-pr by using fetch & checkout instead of pull

pull/1780/head
Louis Lam 2 years ago
parent e90a4f1f34
commit 7b8f9c7655

@ -44,8 +44,9 @@ RUN apt update \
RUN rm -rf ./* && chown node /app RUN rm -rf ./* && chown node /app
USER node USER node
RUN git config --global user.email "no-reply@no-reply.com"
RUN git clone --branch pr-test https://github.com/louislam/uptime-kuma.git . RUN git config --global user.name "PR Tester"
RUN git clone https://github.com/louislam/uptime-kuma.git .
RUN npm ci RUN npm ci
EXPOSE 3000 3001 EXPOSE 3000 3001

@ -22,7 +22,12 @@ let result = childProcess.spawnSync("git", [ "remote", "add", name, `https://git
console.log(result.stdout.toString()); console.log(result.stdout.toString());
console.error(result.stderr.toString()); console.error(result.stderr.toString());
result = childProcess.spawnSync("git", [ "pull", name, branch ]); result = childProcess.spawnSync("git", [ "fetch", name, branch ]);
console.log(result.stdout.toString());
console.error(result.stderr.toString());
result = childProcess.spawnSync("git", [ "checkout", branch, "--force" ]);
console.log(result.stdout.toString()); console.log(result.stdout.toString());
console.error(result.stderr.toString()); console.error(result.stderr.toString());

Loading…
Cancel
Save