File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -50,11 +50,37 @@ jobs:
5050 run : |
5151 set -euo pipefail
5252
53- version="$(cvecli --version 2>/dev/null || true)"
54- version="$(echo "$version" | head -n 1 | tr -d '\r')"
55- if [ -z "$version" ]; then
53+ info_json="$(brew info --json=v2 \"${FORMULA_NAME}\")"
54+ version="$(python3 - <<'PY'
55+ import json
56+ import sys
57+
58+ data = json.loads(sys.stdin.read())
59+ formulae = data.get("formulae") or []
60+ f = formulae[0] if formulae else {}
61+
62+ installed = f.get("installed") or []
63+ if installed :
64+ v = (installed[0] or {}).get("version")
65+ if v :
66+ print(v)
67+ raise SystemExit(0)
68+
69+ versions = f.get("versions") or {}
70+ for key in ("stable", "head") :
71+ v = versions.get(key)
72+ if v :
73+ print(v)
74+ raise SystemExit(0)
75+
76+ print("unknown")
77+ PY
78+ <<<"$info_json")"
79+
80+ if [ -z "${version}" ]; then
5681 version="unknown"
5782 fi
83+
5884 echo "CVECLI_VERSION=${version}" >> "$GITHUB_ENV"
5985
6086 - name : Run CVE functional test
Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ cvecli --version
4545cvecli --id CVE-2025-55184
4646```
4747
48- ## Installation (macOS / Homebrew)
48+ ## Installation (macOS / Linux / Homebrew)
4949
5050``` bash
5151brew tap DebaA17/tap
@@ -59,13 +59,6 @@ cvecli --version
5959cvecli --id CVE-2025-55184
6060```
6161
62- ## Installation (Linux / Homebrew)
63-
64- ``` bash
65- brew tap DebaA17/tap
66- brew install cvecli
67- ```
68-
6962## Installation (Local/Global Usage)
7063``` bash
7164git clone https://github.com/DebaA17/CVE-scanner-cli.git
You can’t perform that action at this time.
0 commit comments