ci: fix divergent branches by reset --hard origin/main
Some checks failed
Build & Deploy Go API / build (push) Failing after 14s

This commit is contained in:
Joe
2026-07-19 20:53:25 +08:00
parent 8071f8aa92
commit fc8d7ecaad

View File

@@ -19,8 +19,12 @@ jobs:
WORK=/root/.cache/demo-go-api
mkdir -p $WORK
cd $WORK
[ -d .git ] || git clone http://joe:${GITEA_TOKEN}@192.168.1.212:3000/joe/demo-go-api.git .
git pull
if [ -d .git ]; then
git reset --hard origin/main
git clean -fd
else
git clone http://joe:${GITEA_TOKEN}@192.168.1.212:3000/joe/demo-go-api.git .
fi
- name: Login to Harbor
run: docker login 192.168.1.212:1180 -u admin -p "$HARBOR_PASSWORD"