action summary
This commit is contained in:
@@ -196,19 +196,24 @@ jobs:
|
|||||||
with open(out_path, "w") as f:
|
with open(out_path, "w") as f:
|
||||||
json.dump(results, f)
|
json.dump(results, f)
|
||||||
print(json.dumps(results, indent=2))
|
print(json.dumps(results, indent=2))
|
||||||
PY
|
|
||||||
|
|
||||||
python3 -c '
|
step_summary = os.environ.get("GITHUB_STEP_SUMMARY")
|
||||||
import json, os, sys
|
if step_summary:
|
||||||
with open(sys.argv[1]) as f:
|
with open(step_summary, "a") as sf:
|
||||||
data = json.load(f)
|
sf.write("### 🛡️ CVE 스캔 결과 요약\n\n")
|
||||||
print("### 🛡️ CVE 스캔 결과 요약\n")
|
sf.write("| Catalog | Version | Image | Critical | High | Medium | Low | Summary |\n")
|
||||||
print("| Catalog | Version | Image | Critical | High | Medium | Low | Summary |")
|
sf.write("| --- | --- | --- | --- | --- | --- | --- | --- |\n")
|
||||||
print("| --- | --- | --- | --- | --- | --- | --- | --- |")
|
for r in results:
|
||||||
for item in data:
|
cat = r.get("catalog") or "-"
|
||||||
summary = item.get("summary", "").replace("|", "\\|")
|
ver = r.get("version") or "-"
|
||||||
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} |")
|
img = r.get("image") or "-"
|
||||||
' "$OUT_DIR/cve-summary.json" >> "$GITHUB_STEP_SUMMARY"
|
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 스캔 결과 전송
|
- name: CVE 스캔 결과 전송
|
||||||
|
|||||||
Reference in New Issue
Block a user