From 918f03ef79516f2bf5988c6335d9549a0da095fe Mon Sep 17 00:00:00 2001 From: uzivibecode Date: Fri, 27 Feb 2026 17:36:02 +0000 Subject: [PATCH] ci: auto mkdir + git init in pipeline --- .woodpecker.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.woodpecker.yml b/.woodpecker.yml index aa7b4f3..d0b68f9 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -3,9 +3,11 @@ pipeline: image: alpine/git secrets: [ DEPLOY_PATH ] commands: + - mkdir -p $DEPLOY_PATH - cd $DEPLOY_PATH + - if [ ! -d ".git" ]; then git init; fi - git config --global --add safe.directory $DEPLOY_PATH - - git remote set-url origin https://git.sukabelajar.web.id/${CI_REPO}.git || true + - git remote set-url origin https://git.sukabelajar.web.id/${CI_REPO}.git 2>/dev/null || git remote add origin https://git.sukabelajar.web.id/${CI_REPO}.git - git fetch origin ${CI_COMMIT_BRANCH} - git reset --hard origin/${CI_COMMIT_BRANCH} - echo "✅ Deploy ${CI_REPO_NAME} selesai!"