added GIT_REF
This commit is contained in:
@ -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 .
|
||||
|
Reference in New Issue
Block a user