Interface GitHubBranch

Represents a GitHub branch.

interface GitHubBranch {
    commit: { sha: string; url: string };
    name: string;
    protected: boolean;
    protection?: {
        enabled: boolean;
        required_status_checks:
            | null
            | { contexts: string[]; enforcement_level: string };
    };
}

Properties

commit: { sha: string; url: string }

The latest commit on this branch

Type declaration

  • sha: string

    Commit SHA

  • url: string

    API URL to the commit

name: string

Branch name (e.g., 'main', 'feature/my-feature')

protected: boolean

Whether this branch is protected

protection?: {
    enabled: boolean;
    required_status_checks:
        | null
        | { contexts: string[]; enforcement_level: string };
}

Branch protection details (only present when using authenticated requests)

Type declaration

  • enabled: boolean

    Whether protection is enabled

  • required_status_checks: null | { contexts: string[]; enforcement_level: string }

    Required status checks