Skip to content

Support custom branch selection in webhook handlersย #280

@dottxado

Description

@dottxado

The custom branch selection feature from PR #275 is not properly integrated into the webhook handlers, where the check on the received branch is still executed against the default_branch in the case of GitHub and GitLab:

// We only care about the default branch but don't want to send an error still.
if ( 'refs/heads/' . $params['repository']['default_branch'] !== $params['ref'] ) {
return new WP_REST_Response( [ 'result' => 'Not the default branch' ] );
}

// We only care about the default branch but don't want to send an error still.
if ( 'refs/heads/' . $params['project']['default_branch'] !== $params['ref'] ) {
return new WP_REST_Response( [ 'result' => 'Not the default branch' ] );
}

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