fix all workflows: use env vars for python f-strings

This commit is contained in:
2026-03-09 16:20:03 +00:00
parent a377ba9d2c
commit b35d617b31
3 changed files with 12 additions and 6 deletions
+6 -2
View File
@@ -55,12 +55,16 @@ jobs:
url="https://github.com/zen-browser/desktop/releases/download/${latest_version}/zen-x86_64.AppImage"
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
import re
import os
p='modules/pkgs/zen-browser.nix'
s=open(p).read()
s=re.sub(r'version\s*=\s*"[^"]+"', f'version = "{latest_version}"', s, count=1)
s=re.sub(r'hash\s*=\s*"[^"]+"', f'hash = "{new_hash}"', 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 = "{os.environ["NEW_HASH"]}"', s, count=1)
open(p,'w').write(s)
PY