text_matches: Text matches#

The title or the description of a pull request matches a text or a regex.

Holds when the text of the input field matches the input text as the input mode says. The case of letters does not matter, unless case_sensitive is on. The column Text has it.

A regex is a regular expression of Python, such as ^(fix|feat):, of at most 100 characters. Repetitions of groups that repeat themselves, such as (a+)+, and back-references, such as \1, are refused: they can take very long to match, and the table of pull requests evaluates the columns of its address for every visitor.

It is checked on pull requests only. While the data of a pull request is not complete, the condition cannot be assessed yet.

Inputs#

Name

Type

Required

What it is

field

choice

yes

title or description.

mode

choice

yes

starts (starts with), ends (ends with), contains or regex.

text

string

yes

The text to match, or the regex, at most 100 characters.

case_sensitive

bool

no, false

Whether the case of letters matters.

The inputs as JSON:

{"field": "title", "mode": "regex", "text": "^(fix|feat):"}

In the address of the table, such as text~applies~title~starts~fix; a column that matches the case ends with ~case.

Data#

The update of the repository reads in the background:

issue

Whether the pull request is open, closed or merged, its title and its description. Permissions of the GitHub App: pull_requests: read; webhooks: pull_request.

API reference#

class pycal_dashboard.conditions.condition.text_matches.TextMatches#

Bases: Condition

A text of a pull request matches: it starts with, ends with or contains a text, or a regex.

Holds when the text of the input field (title or description) matches the input text as the input mode says: starts, ends, contains or regex. The case of letters does not matter, unless case_sensitive is on. A regex has at most 100 characters and none of the forms that can be slow, such as (a+)+.

classmethod assess(issue, values)#

Whether the text of the pull request matches.

Parameters:
  • issue – The pull request.

  • values – field, mode, text and case_sensitive.

Returns:

True if it matches.