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

Function readReusableStatusComment

actions/setup/js/add_workflow_run_comment.cjs:137–153  ·  view source on GitHub ↗

* @param {any} rawContext * @returns {ReusableStatusComment | null}

(rawContext)

Source from the content-addressed store, hash-verified

135 * @returns {ReusableStatusComment | null}
136 */
137function readReusableStatusComment(rawContext) {
138 const awContext = extractAwContextFromPayload(rawContext?.payload);
139 if (!awContext) {
140 return null;
141 }
142
143 const rawId = awContext.status_comment_id ?? awContext.statusCommentId;
144 const id = rawId == null ? "" : String(rawId).trim();
145 if (!id) {
146 return null;
147 }
148
149 const rawUrl = awContext.status_comment_url ?? awContext.statusCommentUrl;
150 const url = typeof rawUrl === "string" ? rawUrl.trim() : "";
151 const repo = parseRepoSlug(awContext.status_comment_repo ?? awContext.statusCommentRepo);
152 return { id, url, repo };
153}
154
155/**
156 * @param {any} rawContext

Callers 1

Calls 2

parseRepoSlugFunction · 0.70

Tested by

no test coverage detected