From 47b76306b267271e55428f27dd26ad3b71aec618 Mon Sep 17 00:00:00 2001 From: SG Date: Tue, 31 Mar 2026 12:09:52 +0300 Subject: [PATCH] updates --- docker-build-push/action.yml | 12 ++++++------ docker-build-push/build.sh | 7 ++++--- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/docker-build-push/action.yml b/docker-build-push/action.yml index 8f7e9ce..e8a6719 100644 --- a/docker-build-push/action.yml +++ b/docker-build-push/action.yml @@ -2,12 +2,12 @@ name: docker-build-push description: Clone app repo, build Docker image, and push it to the private registry inputs: - git_base_url: - description: Base Git host without scheme path, for example git.example.com + git_server_url: + description: Full Git server URL, for example https://git.example.com required: true git_repository: - description: Repository path, for example example/signup_app + description: Repository path, for example example/testapp required: true git_sha: @@ -24,7 +24,7 @@ inputs: registry: description: OCI registry host - required: true + required: false default: zmeyka.exocortex.ru registry_user: @@ -36,7 +36,7 @@ inputs: required: true image_name: - description: Image path inside registry, for example example/signup_app + description: Image path inside registry, for example example/testapp required: true image_tag: @@ -59,7 +59,7 @@ runs: - name: Run build and push script shell: bash env: - INPUT_GIT_BASE_URL: ${{ inputs.git_base_url }} + INPUT_GIT_SERVER_URL: ${{ inputs.git_server_url }} INPUT_GIT_REPOSITORY: ${{ inputs.git_repository }} INPUT_GIT_SHA: ${{ inputs.git_sha }} INPUT_GIT_USER: ${{ inputs.git_user }} diff --git a/docker-build-push/build.sh b/docker-build-push/build.sh index b896119..6059c22 100755 --- a/docker-build-push/build.sh +++ b/docker-build-push/build.sh @@ -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