diff --git a/action.yaml b/action.yaml index 6fddacf..9e20224 100644 --- a/action.yaml +++ b/action.yaml @@ -1,5 +1,5 @@ name: Ahk2Exe -description: GitHub Action to compile AutoHotKey scripts using Ahk2Exe +description: GitHub Action to compile AutoHotKey v1 scripts using Ahk2Exe author: nekocodeX inputs: @@ -26,7 +26,9 @@ runs: shell: pwsh run: | $cwd = (Get-Item .).FullName; - Invoke-WebRequest "https://www.autohotkey.com/download/ahk.zip" -OutFile "$cwd\autohotkey.zip"; + $latestV1Tag = (Invoke-RestMethod -Uri "https://api.github.com/repos/AutoHotkey/AutoHotkey/git/refs/tags" -Method Get) | Where-Object { $_.ref -match 'refs/tags/v1\.' } | Select-Object -Last 1 + $ahkVersion = $latestV1Tag.ref -replace 'refs/tags/v', '' + Invoke-WebRequest "https://github.com/AutoHotkey/AutoHotkey/releases/download/v$ahkVersion/AutoHotkey_$ahkVersion.zip" -OutFile "$cwd\autohotkey.zip"; Expand-Archive -Path "$cwd\autohotkey.zip" -DestinationPath "$cwd\_autohotkey\" -Force; Remove-Item -Path "$cwd\autohotkey.zip" -Force Write-Output ("$cwd\_autohotkey\;" + "$cwd\_autohotkey\Compiler") | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append