Files
ai-media-hub/scripts/push.ps1
T
GHStaK 139e8f8781
build-push / docker (push) Successful in 4m7s
Add Windows PowerShell dev workflow
2026-03-17 15:47:01 +09:00

32 lines
794 B
PowerShell

param(
[string]$Remote = "origin",
[string]$Branch = "",
[switch]$SetUpstream
)
Set-StrictMode -Version Latest
$ErrorActionPreference = "Stop"
. (Join-Path $PSScriptRoot "dev-tools.ps1")
Use-LocalTooling
$credential = Import-GitCredential
if (-not $Branch) {
$Branch = (& git branch --show-current).Trim()
}
if (-not $Branch) {
throw "현재 브랜치를 찾지 못했습니다."
}
$pair = "{0}:{1}" -f $credential.Username, $credential.Password
$token = [Convert]::ToBase64String([Text.Encoding]::UTF8.GetBytes($pair))
$gitArgs = @("-c", "http.extraheader=AUTHORIZATION: Basic $token", "push")
if ($SetUpstream) {
$gitArgs += @("--set-upstream", $Remote, $Branch)
} else {
$gitArgs += @($Remote, $Branch)
}
Write-Step "git push $Remote $Branch"
& git @gitArgs