MCPcopy Create free account
hub / github.com/github/gh-aw / buildWorkflowRunUrl

Function buildWorkflowRunUrl

actions/setup/js/workflow_metadata_helpers.cjs:34–47  ·  view source on GitHub ↗

* Build a workflow run URL from the provided context and workflow repository. * * This is the canonical helper for constructing attribution run URLs in safe-output * handlers. It must always receive the **original** workflow repo (not an overridden * cross-repo effectiveContext) so that footer l

(ctx, workflowRepo)

Source from the content-addressed store, hash-verified

32 * @returns {string} The full workflow run URL
33 */
34function buildWorkflowRunUrl(ctx, workflowRepo) {
35 const server = ctx.serverUrl || process.env.GITHUB_SERVER_URL || "https://github.com";
36 let { owner = "", repo = "" } = workflowRepo ?? {};
37 if (!owner || !repo) {
38 // When context is spread (e.g. `{...context}`), prototype getters like context.repo
39 // are not included. Fall back to GITHUB_REPOSITORY for the workflow repo.
40 const [envOwner = "", envRepo = ""] = (process.env.GITHUB_REPOSITORY || "").split("/");
41 if (envOwner && envRepo) {
42 owner = owner || envOwner;
43 repo = repo || envRepo;
44 }
45 }
46 return `${server}/${owner}/${repo}/actions/runs/${ctx.runId}`;
47}
48
49module.exports = {
50 getWorkflowMetadata,

Callers 15

mainFunction · 0.85
mainFunction · 0.85
executeIssueUpdateFunction · 0.85
getWorkflowMetadataFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected