mergeable
mergeable copied to clipboard
TypeError: Cannot read property 'filter' of undefined
The configuration in my mergeable.yml looks like:
version: 2
mergeable:
- when: pull_request.*
name: JIRA linked check
filter:
- do: repository
topics:
must_include:
regex: 'topic1'
message: 'Mergeable only enabled for topic1'
validate:
- do: title
must_exclude:
regex: ^\[WIP\]
message: 'Cannot merge Work In Progress'
- do: or
validate:
- do: title
or:
- must_include:
regex: 'jira-[\d]{1,6}'
message: 'Jira Ticket must be present in the pull request title'
- must_include:
regex: 'myjira-\d+'
message: 'JIRA Ticket for other board must be present in the pull request title'
- do: description
or:
- must_include:
regex: 'jira-[\d]{1,6}'
message: 'Jira Ticket must be present in the pull request description'
- must_include:
regex: 'myjira-\d+'
message: 'blah....'
- must_include:
regex: '(close[sd]?|fix(es|ed)?|close[sd]?|resolve[sd]?) ([a-z0-9_-]+\/[a-z0-9_-]+)?#\d+'
message: 'The pull request must address a BBGitHub issue'
- do: label
must_include:
regex: 'no-ticket'
message: 'If no Jira ticketis required, please include the label "no-ticket" in your pull request'
pass:
- do: request_review
teams: ['myteam']
- when: pull_request.*
name: PR mergeable check
filter:
- do: repository
topics:
must_include:
regex: 'topic1'
message: 'Mergeable only enabled for topic1'
validate:
- do: approvals
min:
count: 1 # Number of minimum reviewers.
message: 'At least one approval is required'
- do: label
must_exclude:
regex: 'donotmerge|dontmerge|DONOTMERGE'
message: 'Cannot merge with Do Not Merge label'
I am not sure why I get an error on filter field. I only want to run the validation checks if the repository has the specified topic.
Is the config structure wrong or am I using filter incorrectly?
@saloni-jain this is most likely because of wrong config structure, can you send me the screen shot of the full error received?
Here it is.
