Harmont docs
Pipeline SDK

Triggers

Run a pipeline on push or pull request.

Pass triggers=[...] when you register a pipeline to control when Harmont runs it on a connected repository.

Push

push(branch=None, tag=None) -> PushTrigger
ParameterTypeDefaultDescription
branchstr | list[str] | tuple[str, ...] | NoneNone
tagstr | list[str] | tuple[str, ...] | NoneNone

Pull request

pull_request(branches=None, types=None) -> PullRequestTrigger
ParameterTypeDefaultDescription
branchesstr | list[str] | tuple[str, ...] | NoneNone
typeslist[str] | tuple[str, ...] | NoneNone
import harmont as hm

@hm.pipeline(
    "ci",
    triggers=[hm.push(branch="main"), hm.pull_request(branches=["main"])],
)
def ci() -> hm.Step:
    return hm.sh("make test")
import { pipeline, push, pullRequest, sh, type PipelineDefinition } from "@harmont/hm";

const pipelines: PipelineDefinition[] = [
  {
    slug: "ci",
    triggers: [push({ branch: "main" }), pullRequest({ branches: ["main"] })],
    pipeline: pipeline([sh("make test")]),
  },
];
export default pipelines;

Full options are in the triggers reference.

On this page