The config module is used in cases where you need to override the default Github token and repository path associated with the event payload.

By default, a GITHUB_TOKEN with permissions for all repositories enabled in the Github app installation is injected into an automation’s runtime environment, so needing to manually override this default is unlikely. However, a webhook or schedule event automation will need to set the repository path manually, while github.* events do not require this.

Example Usage

from blocks import config

config.set_github_token("your-github-token")
config.set_github_repository_path("your-github-repository-path") # Example: "YourOrg/repo-name"

Methods

set_github_token

config.set_github_token(token)

Sets the GITHUB_TOKEN environment variable.

token
string

The GitHub token to use.

set_github_repository_path

config.set_github_repository_path(path)

Sets the GITHUB_REPOSITORY_PATH environment variable.

path
string

The GitHub repository path to use. For example, YourOrg/repo-name.