Skip to content

fix: can-be-merged should not fail when branch has no protection rules #2722

@rnetser

Description

@rnetser

Problem

When a target branch has no branch protection rules configured, the can-be-merged check fails with the unhelpful message:

Failed to check if can be merged, check logs

This is misleading — the PR may be perfectly mergeable, but the check fails because it cannot find protection rules to evaluate against.

Expected Behavior

  1. If no branch protection rules exist for the target branch, can-be-merged should pass (not fail)
  2. The log message should be clearer, e.g.: "No branch protection rules found for branch v4.19, skipping protection check"

Current Behavior

The check fails with a generic error message that gives no indication the issue is missing protection rules rather than an actual merge conflict or problem.

Context

Observed on PR #2720 targeting v4.19 — the can-be-merged check fails despite the PR having no merge conflicts and all other checks passing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions