This commit is contained in:
SG
2026-03-31 12:09:52 +03:00
parent 91c0519c64
commit 47b76306b2
2 changed files with 10 additions and 9 deletions

View File

@@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -euo pipefail
: "${INPUT_GIT_BASE_URL:?missing INPUT_GIT_BASE_URL}"
: "${INPUT_GIT_SERVER_URL:?missing INPUT_GIT_SERVER_URL}"
: "${INPUT_GIT_REPOSITORY:?missing INPUT_GIT_REPOSITORY}"
: "${INPUT_GIT_SHA:?missing INPUT_GIT_SHA}"
: "${INPUT_GIT_USER:?missing INPUT_GIT_USER}"
@@ -17,7 +17,7 @@ set -euo pipefail
case "${INPUT_IMAGE_NAME}" in
*/*) ;;
*)
echo "INPUT_IMAGE_NAME must include owner/name, for example: example/signup_app" >&2
echo "INPUT_IMAGE_NAME must include owner/name, for example: example/testapp" >&2
exit 1
;;
esac
@@ -38,7 +38,8 @@ mkdir -p "${workdir}"
git init "${workdir}"
cd "${workdir}"
git remote add origin "https://${INPUT_GIT_USER}:${INPUT_GIT_TOKEN}@${INPUT_GIT_BASE_URL}/${INPUT_GIT_REPOSITORY}.git"
git remote add origin "${INPUT_GIT_SERVER_URL}/${INPUT_GIT_REPOSITORY}.git"
git config http.extraHeader "Authorization: Basic $(printf '%s:%s' "${INPUT_GIT_USER}" "${INPUT_GIT_TOKEN}" | base64 -w0)"
git fetch --depth=1 origin "${INPUT_GIT_SHA}"
git checkout --detach FETCH_HEAD