From 7c74de52a4f7e511902adcffc230dd4df8957d69 Mon Sep 17 00:00:00 2001 From: Chad Bentz <1760475+felickz@users.noreply.github.com> Date: Thu, 16 Jan 2025 21:48:22 +0000 Subject: [PATCH] feat: include line number in location path for most recent instance --- dist/index.js | 4 +++- src/context/CodeScanning.ts | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index 8987eff..4f3aa30 100644 --- a/dist/index.js +++ b/dist/index.js @@ -64736,7 +64736,9 @@ class CodeScanning extends Printable { a.rule?.security_severity_level || a.rule?.severity || "", this.cweFromTags(a), a.tool?.name || "", - a.most_recent_instance?.location.path || "", + a.most_recent_instance?.location?.path + ? `${a.most_recent_instance.location.path}#L${a.most_recent_instance.location.start_line}` + : "", a.html_url, ]); } diff --git a/src/context/CodeScanning.ts b/src/context/CodeScanning.ts index 2dfddf2..ee790a3 100644 --- a/src/context/CodeScanning.ts +++ b/src/context/CodeScanning.ts @@ -68,7 +68,9 @@ export class CodeScanning extends Printable implements Feature { a.rule?.security_severity_level || a.rule?.severity || "", this.cweFromTags(a), a.tool?.name || "", - a.most_recent_instance?.location.path || "", + a.most_recent_instance?.location?.path + ? `${a.most_recent_instance.location.path}#L${a.most_recent_instance.location.start_line}` + : "", a.html_url, ]); }