ci: dynamically fetch latest stylua version
Some checks failed
Luacheck / luacheck (push) Successful in 9s
StyLua / stylua (push) Failing after 1s

This commit is contained in:
Jeremie Fraeys 2026-02-08 15:19:27 -05:00
parent a397bf516d
commit f5b484bb59
No known key found for this signature in database

View file

@ -14,7 +14,7 @@ jobs:
steps:
- run: |
if ! command -v stylua &> /dev/null; then
curl -L -o /tmp/stylua.zip "https://github.com/JohnnyMorganz/StyLua/releases/download/v2.0.2/stylua-linux.zip"
curl -sL "https://api.github.com/repos/JohnnyMorganz/StyLua/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/' | xargs -I {} curl -sL -o /tmp/stylua.zip "https://github.com/JohnnyMorganz/StyLua/releases/download/{}/stylua-linux.zip"
unzip /tmp/stylua.zip -d /tmp
sudo mv /tmp/stylua /usr/local/bin/
rm /tmp/stylua.zip