Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
lbonilla68 opened this issue Aug 23, 2023 · 0 comments
Open

Comments

@lbonilla68
Copy link

lbonilla68 commented Aug 23, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant