Skip to content

Commit

Permalink
Use Latest Release on GitHub Helper for checking for updates of AWS I…
Browse files Browse the repository at this point in the history
…AM Authenticator
  • Loading branch information
douglaswth committed Oct 15, 2024
1 parent 18f7aa0 commit ec65c87
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/au.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ jobs:
run: |
git clone -q https://github.com/majkinetor/au.git $Env:TEMP/au
. "$Env:TEMP/au/scripts/Install-AU.ps1" $Env:au_version
- name: Install Latest Release on GitHub Helper
run: choco install largh --yes
- name: Check update for packages
run: |
$ErrorActionPreference = 'Continue'
Expand Down
9 changes: 4 additions & 5 deletions automatic/aws-iam-authenticator/update.ps1
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
Import-Module au

$latest_release = 'https://github.com/kubernetes-sigs/aws-iam-authenticator/releases/latest'
$repo = 'https://github.com/kubernetes-sigs/aws-iam-authenticator'

function global:au_GetLatest {
$download_page = Invoke-WebRequest -Uri $latest_release -UseBasicParsing
$regex = '^.+/aws-iam-authenticator_(\d+\.\d+\.\d+)_windows_amd64\.exe$'
$url64 = "https://github.com$($download_page.Links | Where-Object href -Match $regex | Select-Object -First 1 -ExpandProperty href)"
$version = $url64 -replace $regex, '$1'
$release = Get-LatestReleaseOnGitHub -URL $repo -AccessToken $env:github_api_key
$version = $release.Tag.trim('v.')
$url64 = $release.Assets | Where-Object { $_.FileName -like '*_windows_amd64.exe' } | Select-Object -First 1 -ExpandProperty URL
return @{ Version = $version; URL64 = $url64 }
}

Expand Down

0 comments on commit ec65c87

Please sign in to comment.