fix handy workflow and add push trigger for testing
handy update / update-handy (push) Failing after 8s

This commit is contained in:
2026-03-09 16:18:58 +00:00
parent 6f3dfa8afa
commit a377ba9d2c
+8 -2
View File
@@ -1,6 +1,8 @@
name: handy update name: handy update
on: on:
push:
branches: [main]
schedule: schedule:
- cron: "40 6 * * *" - cron: "40 6 * * *"
workflow_dispatch: workflow_dispatch:
@@ -56,12 +58,16 @@ jobs:
url="https://github.com/cjpais/Handy/releases/download/v${latest_version}/Handy_${latest_version}_amd64.AppImage" url="https://github.com/cjpais/Handy/releases/download/v${latest_version}/Handy_${latest_version}_amd64.AppImage"
new_hash=$(nix store prefetch-file --json "$url" | python -c 'import json,sys; print(json.load(sys.stdin)["hash"])') new_hash=$(nix store prefetch-file --json "$url" | python -c 'import json,sys; print(json.load(sys.stdin)["hash"])')
export LATEST_VERSION="$latest_version"
export NEW_HASH="$new_hash"
python - <<PY python - <<PY
import re import re
import os
p='modules/pkgs/handy.nix' p='modules/pkgs/handy.nix'
s=open(p).read() s=open(p).read()
s=re.sub(r'version\s*=\s*"[^"]+"', f'version = "{latest_version}"', s, count=1) s=re.sub(r'version\s*=\s*"[^"]+"', f'version = "{os.environ["LATEST_VERSION"]}"', s, count=1)
s=re.sub(r'hash\s*=\s*"[^"]+"', f'hash = "{new_hash}"', s, count=1) s=re.sub(r'hash\s*=\s*"[^"]+"', f'hash = "{os.environ["NEW_HASH"]}"', s, count=1)
open(p,'w').write(s) open(p,'w').write(s)
PY PY