[Fix] Usa git clone per checkout su Windows
Build and Push Docker Images / Build Windows Container (push) Failing after -2s
Build and Push Docker Images / Build Linux Container (push) Failing after 8m40s
Build and Push Docker Images / Create Multi-Platform Manifest (push) Has been skipped

- Sostituito download ZIP con git clone diretto
- Più veloce e affidabile
- Clone shallow (depth 1) per performance
- Verifica Dockerfile.windows dopo clone
- Git è disponibile sul runner Windows
This commit is contained in:
2026-01-24 13:49:57 +01:00
parent a50b295c59
commit 5915537e83
+11 -33
View File
@@ -99,47 +99,25 @@ jobs:
packages: write
steps:
- name: Download and extract repository
- name: Checkout repository with Git
run: |
echo ===== Downloading repository =====
curl -L -o repo.zip https://github.com/${{ github.repository }}/archive/refs/heads/${{ github.ref_name }}.zip
echo ===== Cloning repository =====
git clone --depth 1 --branch ${{ github.ref_name }} https://github.com/${{ github.repository }}.git repo
if errorlevel 1 (
echo Failed to download repository
echo Failed to clone repository
exit /b 1
)
echo ===== Extracting archive =====
tar -xf repo.zip
if errorlevel 1 (
echo Failed to extract archive
exit /b 1
)
echo ===== Finding extracted folder =====
dir /B /AD
echo ===== Moving files to current directory =====
REM GitHub creates folder with format: repo-name-branch
REM Find first directory and copy its contents
for /d %%i in (*) do (
echo Found directory: %%i
echo Copying contents from %%i to current directory...
robocopy "%%i" . /E /MOVE /NFL /NDL /NJH /NJS
goto :extracted
)
:extracted
echo ===== Cleaning up =====
del repo.zip
echo ===== Verifying files =====
echo Current directory contents:
dir /B
echo ===== Moving files to working directory =====
robocopy repo . /E /MOVE /NFL /NDL /NJH /NJS
rmdir repo /S /Q 2>nul
echo ===== Verifying checkout =====
if exist Dockerfile.windows (
echo SUCCESS: Dockerfile.windows found!
echo SUCCESS: Repository checked out, Dockerfile.windows found
) else (
echo ERROR: Dockerfile.windows not found!
echo ERROR: Dockerfile.windows not found
dir /B
exit /b 1
)
shell: cmd