* 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)
| 383 | * @param {string|undefined} runUrl |
| 384 | */ |
| 385 | async 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 | |
| 414 | function isBuiltinHelpEnabled() { |
| 415 | const raw = (process.env.GH_AW_HELP_COMMAND_ENABLED || "").trim().toLowerCase(); |
no test coverage detected