Tweak comment footer (#208)

* Tweak comment footer

* take 2

* tweak

* tweak

* add dev path

* defensively guard against missing job in the array
This commit is contained in:
Mateusz Burzyński
2026-02-03 18:49:48 +00:00
committed by pullfrog[bot]
parent bfe72ac2cf
commit adc165d95f
3 changed files with 34 additions and 37 deletions
+5 -10
View File
@@ -26,7 +26,7 @@ async function buildCommentFooter({
const repoContext = parseRepoContext();
const runId = process.env.GITHUB_RUN_ID;
let workflowRunHtmlUrl: string | undefined;
let jobId: string | undefined;
if (runId && octokit) {
try {
// fetch jobs to get the job URL for deep linking
@@ -35,10 +35,10 @@ async function buildCommentFooter({
repo: repoContext.name,
run_id: parseInt(runId, 10),
});
// use the first job's URL if available
workflowRunHtmlUrl = jobs.jobs[0]?.html_url ?? undefined;
// use the first job's ID available
jobId = jobs.jobs[0]?.id.toString();
} catch {
// fall back to building URL from runId if jobs can't be fetched
// fall back to computed URL from runId alone
}
}
@@ -49,12 +49,7 @@ async function buildCommentFooter({
url: agent?.url || "https://pullfrog.com",
},
workflowRun: runId
? {
owner: repoContext.owner,
repo: repoContext.name,
runId,
...(workflowRunHtmlUrl ? { htmlUrl: workflowRunHtmlUrl } : {}),
}
? { owner: repoContext.owner, repo: repoContext.name, runId, jobId }
: undefined,
};