Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions windows/clone.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,17 @@ password $Env:DRONE_NETRC_PASSWORD
"@ > (Join-Path $Env:USERPROFILE '_netrc');
}

# Windows-specific: Persist Git credentials by mounting _netrc from the shared path
# so that subsequent steps in the pipeline can use them for authenticated Git operations.
if ($Env:DRONE_PERSIST_CREDS) {
$sourcePath = Join-Path $Env:USERPROFILE '_netrc';
$destinationPath = 'C:\addon\shared\_netrc';
New-Item -ItemType Directory -Path (Split-Path $destinationPath) -Force;
if (Test-Path -Path $sourcePath) {
Copy-Item -Path $sourcePath -Destination $destinationPath -Force;
}
}

if ($Env:DRONE_SSH_KEY) {
mkdir C:\.ssh -Force
echo $Env:DRONE_SSH_KEY > C:\.ssh\id_rsa
Expand Down