Skip to content

Validators

To run actions, the app must receive some sort of trigger request, e.g., a push notification from GitHub. The app checks all incoming requests, and only the ones that pass the check trigger actions. The requests usually contain data that should be passed to the actions, i.e., branch name, so the app must extract the data after the check.

In Sloth CI, a source of trigger requests is called provider; e.g., GitHub, Bitbucket, and GitLab are providers. Each provider uses its own request format and thus requires its own validation and data extraction routine.

Validator implements request checking and data extraction for a particular provider. To add support of a new provider to Sloth CI, we just create a corresponding validator.

Github

Installation

$ pip install sloth-ci-val-github

Usage

provider:
    github:
        # Repository owner. Mandatory parameter.
        owner: moigagoo

        # Repository title as it appears in the URL, i.e. slug.
        # Mandatory parameter.
        repo: sloth-ci

        # Only pushes to these branches will initiate a build.
        # Skip this parameter to allow all branches to fire builds.
        branches:
            - master
            - staging

Bitbucket

GitLab