diff --git a/eng/_util/go-install.ps1 b/eng/_util/go-install.ps1 index ddebb164aa..8a58699318 100644 --- a/eng/_util/go-install.ps1 +++ b/eng/_util/go-install.ps1 @@ -53,6 +53,9 @@ .PARAMETER AzurePipelinePath If set, it will print an Azure DevOps logging command that causes the Azure DevOps to update the PATH environment variable of subsequent build steps to include the binaries folder. +.PARAMETER GitHubActionsPath + If set, it will append the binaries folder to the GITHUB_PATH environment file, causing GitHub Actions + to update the PATH environment variable of subsequent build steps to include the binaries folder. .PARAMETER ProxyAddress If set, it will use the proxy when making web requests .PARAMETER ProxyUseDefaultCredentials @@ -89,6 +92,7 @@ param( [switch]$DryRun, [switch]$NoPath, [switch]$AzurePipelinePath, + [switch]$GitHubActionsPath, [string]$ProxyAddress, [switch]$ProxyUseDefaultCredentials, [string[]]$ProxyBypassList=@(), @@ -686,6 +690,11 @@ function Prepend-ToolsetPathEnv([string]$InstallRoot, [string]$SpecificVersion) Say "Running an Azure Pipelines logging command to prepend `"$BinPath`" to the PATH." Say "##vso[task.prependpath]$BinPath" } + + if ($GitHubActionsPath) { + Say "Appending `"$BinPath`" to the GITHUB_PATH file." + $BinPath | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + } } function PrintDryRunOutput($Invocation) { diff --git a/eng/_util/go.mod b/eng/_util/go.mod index 3fb7313293..4597f22269 100644 --- a/eng/_util/go.mod +++ b/eng/_util/go.mod @@ -9,7 +9,7 @@ go 1.24.0 require ( github.com/golang-jwt/jwt/v5 v5.3.0 github.com/microsoft/go-infra v0.0.7 - github.com/microsoft/go-infra/goinstallscript v1.0.0 + github.com/microsoft/go-infra/goinstallscript v1.1.0 golang.org/x/net v0.47.0 golang.org/x/sys v0.38.0 ) diff --git a/eng/_util/go.sum b/eng/_util/go.sum index e6bbe9771b..74aa7ea253 100644 --- a/eng/_util/go.sum +++ b/eng/_util/go.sum @@ -16,8 +16,8 @@ github.com/microsoft/azure-devops-go-api/azuredevops v1.0.0-b5 h1:YH424zrwLTlyHS github.com/microsoft/azure-devops-go-api/azuredevops v1.0.0-b5/go.mod h1:PoGiBqKSQK1vIfQ+yVaFcGjDySHvym6FM1cNYnwzbrY= github.com/microsoft/go-infra v0.0.7 h1:wl67HhAGlGn6mnFGNFch4F49AC4CN1FQxYiduI4DQbE= github.com/microsoft/go-infra v0.0.7/go.mod h1:IOooBUtSykqU41l41GzZx7/VLmzm1zVQ5IQ/1YpyH+k= -github.com/microsoft/go-infra/goinstallscript v1.0.0 h1:LFakXWLma5+OlsGRvEMxoI6OpF8KMZACzNMKZ5NEmkk= -github.com/microsoft/go-infra/goinstallscript v1.0.0/go.mod h1:SFsdKAEHdmGsGoh8FkksVaxoQ3rnnJ/TBqN09Ml/0Cw= +github.com/microsoft/go-infra/goinstallscript v1.1.0 h1:63Zo4Iw1Ft0swdVl+LKCZPPKv1QZiIRY3ZgyhJyMr5A= +github.com/microsoft/go-infra/goinstallscript v1.1.0/go.mod h1:SFsdKAEHdmGsGoh8FkksVaxoQ3rnnJ/TBqN09Ml/0Cw= golang.org/x/net v0.47.0 h1:Mx+4dIFzqraBXUugkia1OOvlD6LemFo1ALMHjrXDOhY= golang.org/x/net v0.47.0/go.mod h1:/jNxtkgq5yWUGYkaZGqo27cfGZ1c5Nen03aYrrKpVRU= golang.org/x/oauth2 v0.32.0 h1:jsCblLleRMDrxMN29H3z/k1KliIvpLgCkE6R8FXXNgY=