From c8f45f04715e7abaca6e1c47794c647cb9b526ac Mon Sep 17 00:00:00 2001 From: gentlementlegen Date: Fri, 20 Dec 2024 16:18:43 +0900 Subject: [PATCH] feat: runtime info populated for worker and node environments --- src/comment.ts | 8 ++++--- src/helpers/get-run-info.ts | 45 ----------------------------------- src/helpers/runtime-info.ts | 47 +++++++++++++++++++++++++++++++++++++ src/server.ts | 11 +++++++++ 4 files changed, 63 insertions(+), 48 deletions(-) delete mode 100644 src/helpers/get-run-info.ts create mode 100644 src/helpers/runtime-info.ts diff --git a/src/comment.ts b/src/comment.ts index 11260ba..77fdc1c 100644 --- a/src/comment.ts +++ b/src/comment.ts @@ -1,6 +1,6 @@ -import { Context } from "./context"; import { LogReturn, Metadata } from "@ubiquity-os/ubiquity-os-logger"; -import { getPluginName, getRunUrl, getVersion } from "./helpers/get-run-info"; +import { Context } from "./context"; +import { PluginRuntimeInfo } from "./helpers/runtime-info"; import { sanitizeMetadata } from "./util"; const HEADER_NAME = "UbiquityOS"; @@ -67,8 +67,10 @@ async function createStructuredMetadataWithMessage(context: Context, message: Lo } else { instigatorName = context.payload.sender?.login || HEADER_NAME; } + const runUrl = PluginRuntimeInfo.getInstance().runUrl; + const version = await PluginRuntimeInfo.getInstance().version; - const ubiquityMetadataHeader = `