Skip to content

Fail filters on unsupported events #780

@abid-mujtaba

Description

@abid-mujtaba

Scenario

version: 2
mergeable:
  - when: pull_request.*, pull_request_review.*, status.*, check_suite.*
    name: "Automatically merge pull requests once it passes all checks"
    validate: []
    filter:
      - do: author
        must_include:
          regex: "some-bot"
    pass:
      - do: merge
        merge_method: "rebase"

This config is trying to auto-merge PRs that are authored by a particular bot. However, it causes the PR to be merged even when it is not authored by some-bot.

Diagnosis

The author filter does not support status.* and check_suite.* events. For these events the filter passes by default and the merge action is carried out.

Recommended Solution

Add a (backwards-compatible) config to filters that should fail them if a filter is applied to an event it does not support. This is particular useful when one is trying to use must_include filter.

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