Define the merge contract before the test layout

Start by naming the checks that protect a change, the events expected to emit them, and the circumstances in which a result is acceptable. That is a repository decision, not a consequence of the matrix layout. For protected changes, a required result must correspond to the newest applicable commit; earlier successful results do not meet that requirement.

For checks produced by workflow jobs, pull-request consideration depends on the event that initiated the run. The documented eligible set includes pull_request, while merge-queue coverage requires the distinct merge_group event when an Actions check is required there.

A useful contract therefore specifies a stable reporting surface first, then maps test coverage onto it. This is proposed repository architecture, not a provider-prescribed implementation.

Use matrices and dependencies as implementation mechanics

A matrix turns declared variable values into separate job runs for their combinations. It is appropriate for broadening test coverage, but matrix dimensions do not by themselves decide which reported names should become merge requirements.

A job can name prerequisites through needs. Ordinarily, a downstream job will not run after a prerequisite fails or is skipped. An always() condition can instead permit the downstream job to run after those prerequisite jobs finish. Separately, documentation describes a conditionally skipped job as successful; that differs from an entire workflow being filtered out.

Choose the dependency condition deliberately. For example, an aggregate or reporting job may be a clearer contract boundary than making every matrix variation a protected-branch requirement. That choice is an application policy and should be reviewed against the repository’s desired failure signal.

Decision table for four contract boundaries

Proposed review table; the final two columns are repository-owned choices.
CaseTrigger contextMatrix or dependency stateWhether a check can be reportedDocumented merge consequenceProposed repository-policy decisionBounded repository-owned action
pull-request-triggered matrix with successful prerequisitespull_requestDeclared matrix combinations run after their prerequisites succeed.Yes; this event is among the documented workflow-job events eligible for pull-request consideration.A required result must be successful for the latest relevant commit.Choose whether individual matrix results or one reporting result is required.Record the chosen check names and confirm them on a current pull-request commit.
merge queue covered by merge_groupmerge_groupThe queue has a workflow trigger dedicated to its merge-group run.Yes, a required Actions check can be emitted for the queue when that separate event triggers the workflow.Without that event, the required queue result is not reported and the queued merge fails.Require the same intended contract for pull requests and queued merges.Add the queue trigger, then inspect the required check produced by a queued change.
required workflow skipped by path, branch, or commit-message filteringAn otherwise applicable pull-request workflow is filtered before jobs start.Filtering skips the workflow rather than merely skipping one job.No completed workflow-job result is produced; its associated check remains pending.A pending required check prevents merging.Do not require a workflow that may be excluded, or provide an unfiltered reporting path.Review filters against branch-rule requirements and revise one side of that contract.
dependent required-check job following a failed or skipped prerequisiteA workflow event capable of reporting its job checks.A prerequisite named by needs failed or was skipped.By default the dependent job is skipped; an always() condition can let it run once prerequisites finish.A skipped dependent check may not stop a merge.Select an explicit condition or reporting design for this failure path.Document the expected status and test the design in the repository before making it required.

Hypothetical merge-queue failure walkthrough

Consider a hypothetical pull request whose ordinary checks report successfully. It then enters a merge queue, but the relevant workflow has no merge_group trigger. The queue receives no required workflow-job check, so the queued merge cannot proceed under the documented merge-queue behavior.

Running the workflow manually with workflow_dispatch is not a substitute: a run started that way on the pull request’s head branch does not place its workflow-job checks in the pull-request checks area or satisfy the required-status rule. The proposed remediation is to review the required-check contract, add the eligible queue trigger, and retry only after the queue path is configured to report the intended check.

Review boundaries and limitations

  • Keep check selection, filter exceptions, dependency conditions, and remediation ownership in repository policy.
  • Revisit this design when source behavior changes or a compatible workflow feature is retired.
  • This article offers no claimed execution, measurement, or universal assurance that a chosen policy will permit every merge.
  • Preview features, Agentic Workflows, preview runner labels, and version-specific GitHub Enterprise Server guidance are outside this article’s scope.