Skip to content

Ignore disabled workflow_dispatch targets in agentic maintenance routing#36739

Merged
pelikhan merged 4 commits into
mainfrom
copilot/ignore-workflow-dispatch-failure
Jun 3, 2026
Merged

Ignore disabled workflow_dispatch targets in agentic maintenance routing#36739
pelikhan merged 4 commits into
mainfrom
copilot/ignore-workflow-dispatch-failure

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jun 3, 2026

Agentic maintenance currently fails the routing job when one of the configured workflows is disabled and GitHub rejects its workflow_dispatch. This changes routing to treat that case as a skip so other matching workflows still dispatch and the route step summary stays useful.

  • Dispatch error handling

    • Recognize GitHub's disabled-workflow 422 response (Cannot trigger a 'workflow_dispatch' on a disabled workflow) in the centralized router.
    • Skip the disabled target instead of failing the entire routing step.
    • Preserve existing behavior for non-disabled dispatch failures.
  • Route summary rendering

    • Tighten the route step summary for scanability.
    • Render selected commands as markdown list items with escaped slash commands in backticks.
    • Move the configured command inventory behind <details> so the default summary stays short.
  • Coverage

    • Extend routing tests to cover the disabled-workflow error text seen in production.
    • Add a mixed-route case to verify one disabled target does not block other matching dispatches.
    • Update summary assertions to match the new progressive-disclosure format.
try {
  await github.rest.actions.createWorkflowDispatch({ workflow_id, ref, inputs });
} catch (error) {
  if (isDisabledWorkflowDispatchError(error)) {
    core.info(`Skipping workflow '${workflow_id}' because it is disabled.`);
    return false;
  }
  throw error;
}

Copilot AI and others added 3 commits June 3, 2026 17:32
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@pelikhan pelikhan marked this pull request as ready for review June 3, 2026 22:09
Copilot AI review requested due to automatic review settings June 3, 2026 22:09
@pelikhan pelikhan merged commit 90114e9 into main Jun 3, 2026
@pelikhan pelikhan deleted the copilot/ignore-workflow-dispatch-failure branch June 3, 2026 22:09
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the agentic maintenance router to gracefully handle GitHub API workflow_dispatch failures caused by disabled workflows, treating them as a skip so routing can continue and still provide a useful step summary.

Changes:

  • Skip (instead of fail) when createWorkflowDispatch returns the disabled-workflow 422 error text (“Cannot trigger a 'workflow_dispatch' on a disabled workflow”).
  • Refactor step summary rendering to be shorter by default, with configured commands moved into a <details> block and commands rendered as backticked list items.
  • Extend routing tests to cover the production disabled-workflow message and a mixed label-routing scenario where one disabled target does not block another dispatch.
Show a summary per file
File Description
actions/setup/js/route_slash_command.cjs Expands disabled-dispatch detection and updates step summary formatting to a shorter, progressive-disclosure layout.
actions/setup/js/route_slash_command.test.cjs Updates summary assertions and adds coverage for the production disabled-workflow message plus mixed label-route dispatch behavior.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 2/2 changed files
  • Comments generated: 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants