From d2d20ce3b283f35448d3bc00809d2a9bb5f616a1 Mon Sep 17 00:00:00 2001 From: ychangkim Date: Wed, 22 Jul 2026 17:43:34 +0900 Subject: [PATCH] action summary --- .github/workflows/cve-edge-post.yml | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/.github/workflows/cve-edge-post.yml b/.github/workflows/cve-edge-post.yml index 6c9fb77..ff0fe65 100644 --- a/.github/workflows/cve-edge-post.yml +++ b/.github/workflows/cve-edge-post.yml @@ -196,19 +196,24 @@ jobs: with open(out_path, "w") as f: json.dump(results, f) print(json.dumps(results, indent=2)) - PY - python3 -c ' - import json, os, sys - with open(sys.argv[1]) as f: - data = json.load(f) - print("### 🛡️ CVE 스캔 결과 요약\n") - print("| Catalog | Version | Image | Critical | High | Medium | Low | Summary |") - print("| --- | --- | --- | --- | --- | --- | --- | --- |") - for item in data: - summary = item.get("summary", "").replace("|", "\\|") - print(f"| {item.get(\"catalog\", \"-\")} | {item.get(\"version\", \"-\")} | `{item.get(\"image\", \"-\")}` | {item.get(\"critical\", 0)} | {item.get(\"high\", 0)} | {item.get(\"medium\", 0)} | {item.get(\"low\", 0)} | {summary} |") - ' "$OUT_DIR/cve-summary.json" >> "$GITHUB_STEP_SUMMARY" + step_summary = os.environ.get("GITHUB_STEP_SUMMARY") + if step_summary: + with open(step_summary, "a") as sf: + sf.write("### 🛡️ CVE 스캔 결과 요약\n\n") + sf.write("| Catalog | Version | Image | Critical | High | Medium | Low | Summary |\n") + sf.write("| --- | --- | --- | --- | --- | --- | --- | --- |\n") + for r in results: + cat = r.get("catalog") or "-" + ver = r.get("version") or "-" + img = r.get("image") or "-" + crit = r.get("critical", 0) + high = r.get("high", 0) + med = r.get("medium", 0) + low = r.get("low", 0) + summ = (r.get("summary") or "").replace("|", "\\|") + sf.write(f"| {cat} | {ver} | `{img}` | {crit} | {high} | {med} | {low} | {summ} |\n") + PY - name: CVE 스캔 결과 전송