From ffbaab63e401bddb61ef932e71611c7a4f216033 Mon Sep 17 00:00:00 2001 From: Saif Alaqqad Date: Fri, 14 Nov 2025 22:29:43 +0300 Subject: [PATCH 1/2] Fix autohotkey download url --- action.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/action.yaml b/action.yaml index 6fddacf..895c00b 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,8 @@ runs: shell: pwsh run: | $cwd = (Get-Item .).FullName; - Invoke-WebRequest "https://www.autohotkey.com/download/ahk.zip" -OutFile "$cwd\autohotkey.zip"; + $ahkVersion = (Invoke-RestMethod "https://www.autohotkey.com/download/1.1/version.txt") + Invoke-WebRequest "https://www.autohotkey.com/download/1.1/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 From b1ba4c735a75f4b4cc60df5746ed3d855d9bcf13 Mon Sep 17 00:00:00 2001 From: Saif Alaqqad Date: Fri, 14 Nov 2025 23:02:30 +0300 Subject: [PATCH 2/2] Use github api + releases --- action.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/action.yaml b/action.yaml index 895c00b..9e20224 100644 --- a/action.yaml +++ b/action.yaml @@ -26,8 +26,9 @@ runs: shell: pwsh run: | $cwd = (Get-Item .).FullName; - $ahkVersion = (Invoke-RestMethod "https://www.autohotkey.com/download/1.1/version.txt") - Invoke-WebRequest "https://www.autohotkey.com/download/1.1/AutoHotkey_$ahkVersion.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