Author SHA1 Message Date
Floweynt b7f57b57e8 ci: exclude PRs from issue search, sanitize vulnix descriptions for markdown tables
diff-pr / dix (pull_request) Successful in 6m17s
flake-check / flake-check (pull_request) Successful in 51s
lint / lint (pull_request) Successful in 1m48s
2026-09-11 19:23:55 -05:00
Floweynt 4e8a8666b7 ci: drop explicit permissions block from vulnix workflow
diff-pr / dix (pull_request) Successful in 6m16s
flake-check / flake-check (pull_request) Successful in 52s
lint / lint (pull_request) Successful in 1m51s
2026-09-11 16:25:43 -05:00
Floweynt feae577108 ci: log gitea API error responses 2026-09-11 16:25:36 -05:00
2 changed files with 7 additions and 8 deletions
-4
View File
@@ -5,10 +5,6 @@ on:
- cron: "0 6 * * 1" - cron: "0 6 * * 1"
workflow_dispatch: workflow_dispatch:
permissions:
contents: read
issues: write
jobs: jobs:
scan: scan:
runs-on: nix runs-on: nix
+7 -4
View File
@@ -33,13 +33,16 @@ def gitea(method, path, body=None):
req.add_header("Authorization", f'token {os.environ["GH_TOKEN"]}') req.add_header("Authorization", f'token {os.environ["GH_TOKEN"]}')
if data is not None: if data is not None:
req.add_header("Content-Type", "application/json") req.add_header("Content-Type", "application/json")
with urllib.request.urlopen(req) as resp: try:
raw = resp.read() with urllib.request.urlopen(req) as resp:
raw = resp.read()
except urllib.error.HTTPError as e:
sys.exit(f"gitea {method} {path}: {e.code} {e.reason}\n{e.read().decode()}")
return json.loads(raw) if raw else None return json.loads(raw) if raw else None
def find_open_issue(label): def find_open_issue(label):
issues = gitea("GET", f"/issues?state=open&labels={label}") issues = gitea("GET", f"/issues?state=open&type=issues&labels={label}")
return issues[0] if issues else None return issues[0] if issues else None
@@ -236,7 +239,7 @@ def format_vulnix(vulns):
for v in vulns: for v in vulns:
for cve in v["affected_by"]: for cve in v["affected_by"]:
score = v.get("cvssv3_basescore", {}).get(cve) score = v.get("cvssv3_basescore", {}).get(cve)
desc = v.get("description", {}).get(cve, "") desc = v.get("description", {}).get(cve, "").replace("\n", " ").replace("|", "∣")
if len(desc) > 120: if len(desc) > 120:
desc = desc[:117] + "..." desc = desc[:117] + "..."
rows.append((v["pname"], v["version"], cve, score, desc)) rows.append((v["pname"], v["version"], cve, score, desc))