added GIT_REF

This commit is contained in:
2025-06-06 17:33:37 +02:00
parent cfccc65f85
commit 9213dc0c2f
2 changed files with 29 additions and 19 deletions

View File

@ -30,7 +30,6 @@ password $GIT_TOKEN
EOF
chmod 600 ~/.netrc
# Prevent Git from prompting and force it to use .netrc
export GIT_ASKPASS=true
export GIT_TERMINAL_PROMPT=0
fi
@ -41,7 +40,16 @@ rm -rf /app/repo
echo "[CLONE] Cloning repository: $GIT_REPO"
git clone "$GIT_REPO" repo
cd repo/"${APP_PATH:-.}"
cd repo
# Checkout specific branch, tag, or commit if provided
if [ -n "$GIT_REF" ]; then
echo "[GIT] Checking out ref: $GIT_REF"
git fetch --all --tags
git checkout "$GIT_REF"
fi
cd "${APP_PATH:-.}"
echo "[BUILD] Building..."
go build -o /app/app .