Skip to content

Github api usage

Tunisiano18 edited this page Apr 6, 2024 · 3 revisions
$Owner = $releases.Split('/') | Select-Object -Last 1 -Skip 3
$repo = $releases.Split('/') | Select-Object -Last 1 -Skip 2
$tags = Get-GitHubRelease -OwnerName $Owner -RepositoryName $repo -Latest
$urls = $tags.assets.browser_download_url | Where-Object {$_ -match ".exe$"}
$url32 = $urls | Where-Object {$_ -match 'win32'}
$version = $tags.tag_name.Replace('v','')
Update-Metadata -key "releaseNotes" -value $tags.html_url
Update-Metadata -key "licenseUrl" -value $((Get-GitHubLicense -OwnerName $Owner -RepositoryName $repo).download_url)
if($tags.prerelease -match "true") {
    $date = $tags.published_at.ToString("yyyyMMdd")
    $version = "$version-pre$($date)"
}
Clone this wiki locally