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

Function updateStatusCommentWithDispatch

actions/setup/js/route_slash_command.cjs:385–412  ·  view source on GitHub ↗

* Update the shared status comment with dispatched workflow run metadata. * @param {{ status_comment_id: string, status_comment_url?: string, status_comment_repo?: string }} statusCommentContext * @param {string} eventName * @param {string} workflowId * @param {string|undefined} runUrl

(statusCommentContext, eventName, workflowId, runUrl)

Source from the content-addressed store, hash-verified

383 * @param {string|undefined} runUrl
384 */
385async function updateStatusCommentWithDispatch(statusCommentContext, eventName, workflowId, runUrl) {
386 if (!statusCommentContext?.status_comment_id) {
387 return;
388 }
389 if (!runUrl) {
390 return;
391 }
392 try {
393 await createOrReuseStatusComment({
394 ...context,
395 eventName: "workflow_dispatch",
396 payload: {
397 inputs: {
398 event_name: eventName,
399 event_payload: JSON.stringify(context.payload || {}),
400 aw_context: JSON.stringify({
401 ...statusCommentContext,
402 dispatched_workflow_name: workflowId.replace(/\.lock\.yml$/, ""),
403 dispatched_run_url: runUrl,
404 }),
405 },
406 },
407 nonFatalStatusCommentErrors: true,
408 });
409 } catch (error) {
410 core.warning(`Failed to update immediate status comment with dispatched run details: ${String(error)}`);
411 }
412}
413
414function isBuiltinHelpEnabled() {
415 const raw = (process.env.GH_AW_HELP_COMMAND_ENABLED || "").trim().toLowerCase();

Callers 1

mainFunction · 0.85

Calls 1

Tested by

no test coverage detected