From cf9c95038adfd2581007b7bbd88f9fe48ac38080 Mon Sep 17 00:00:00 2001 From: Grzegorz Matoga Date: Thu, 24 Jul 2025 18:24:59 +0200 Subject: [PATCH] refactor: update git clone command to remove https prefix and streamline environment variables --- .gitea/workflows/build-and-push.yaml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/build-and-push.yaml b/.gitea/workflows/build-and-push.yaml index f35aa30..e66e9a6 100644 --- a/.gitea/workflows/build-and-push.yaml +++ b/.gitea/workflows/build-and-push.yaml @@ -11,19 +11,21 @@ jobs: steps: - name: Clone repository run: | - git clone https://${{ gitea.actor }}:${{ secrets.GITEATOKEN }}@${{ gitea.server_url }}/${{ gitea.repository }}.git . + # Remove the https:// prefix since gitea.server_url already includes it + git clone ${{ gitea.server_url }}/${{ gitea.repository }}.git . git checkout ${{ gitea.sha }} + env: + GIT_ASKPASS: /bin/echo + GIT_USERNAME: ${{ gitea.actor }} + GIT_PASSWORD: ${{ secrets.GITEATOKEN }} - name: Build and push run: | # Login to registry echo "${{ secrets.GITEATOKEN }}" | docker login "${{ gitea.server_url }}" -u "${{ gitea.actor }}" --password-stdin - # Build with correct image format (no https://) - # Format: registry-host/owner/image:tag + # Build with correct image format IMAGE_NAME="git.eurekin.pl/${{ gitea.repository_owner }}/hello-gitea" - - # Ensure lowercase IMAGE_NAME=$(echo "$IMAGE_NAME" | tr '[:upper:]' '[:lower:]') echo "Building image: $IMAGE_NAME:latest"