mergeability / mergeable

πŸ€– All the missing GitHub automation πŸ™‚ πŸ™Œ
https://mergeable.us
GNU Affero General Public License v3.0
683 stars 116 forks source link

Regex fails to process while searching for presence of multiple string #726

Open lbonilla68 opened 1 year ago

lbonilla68 commented 1 year ago

Hello,

I'm using the following config and mergeable errors our while processing the regex. The regex works fine for me in my regex validator.

version: 2
mergeable:
  - when: pull_request.*
    filter:
      - do: repository
        name:
          must_exclude:
            regex: my-repo
      - do: author
        must_exclude:
          regex: dependabot[bot]
    validate:
      - do: description
        and:
          - no_empty:
              enabled: true
              message: Please provide a description 
          - or:
            - and:
              - must_include:
                  regex: '^(?s)(?!(.*\[x]){2}).*\[x]'
                  regex_flag: none
                  message: Only 1 checkbox must be checked to dictate if it's a Patch, Minor or Major change.

This ensures that only a single item is checked in the description after opening a PR. It should fail if more than 2 checkboxes are checked.

Description Contents

### Description
Provide as much detail as possible.

Ticket: SE or CM #

### Only Check One
- [] Patch - Fix typo or broken logic
- [] Minor - New features or minor changes to configuration
- [] Major - Breaking changes that will require a refactor of composition code

Here is a link to my Regex validation https://regex101.com/r/NkrHhq/1