mirror of
https://github.com/cmderdev/cmder.git
synced 2024-11-10 09:49:12 +08:00
add github variable helpers (credit: @microsoft)
This commit is contained in:
parent
473e9566e7
commit
a49921bb1b
@ -67,6 +67,31 @@ function Digest-Hash($path) {
|
|||||||
return Invoke-Expression "md5sum $path"
|
return Invoke-Expression "md5sum $path"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function Set-GHVariable {
|
||||||
|
param(
|
||||||
|
[Parameter(Mandatory = $true)]
|
||||||
|
[string]$Name,
|
||||||
|
[Parameter(Mandatory = $true)]
|
||||||
|
[string]$Value
|
||||||
|
)
|
||||||
|
|
||||||
|
Write-Verbose "Setting CI variable $Name to $Value" -Verbose
|
||||||
|
|
||||||
|
if ($env:GITHUB_ENV) {
|
||||||
|
"$Name=$Value" | Out-File $env:GITHUB_ENV -Append
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function Get-GHTempPath {
|
||||||
|
$temp = [System.IO.Path]::GetTempPath()
|
||||||
|
if ($env:RUNNER_TEMP) {
|
||||||
|
$temp = $env:RUNNER_TEMP
|
||||||
|
}
|
||||||
|
|
||||||
|
Write-Verbose "Get CI Temp path: $temp" -Verbose
|
||||||
|
return $temp
|
||||||
|
}
|
||||||
|
|
||||||
function Get-VersionStr() {
|
function Get-VersionStr() {
|
||||||
# Clear existing variable
|
# Clear existing variable
|
||||||
if ($string) { Clear-Variable -name string }
|
if ($string) { Clear-Variable -name string }
|
||||||
|
Loading…
Reference in New Issue
Block a user