Skip to content

tari-project/gh-pilot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

2890e6c · Dec 5, 2023
Jan 10, 2023
Dec 5, 2023
Jan 11, 2023
Jan 11, 2023
Oct 18, 2022
Mar 9, 2023
Oct 15, 2022
Feb 21, 2023
Jan 10, 2023
Feb 8, 2023
Sep 17, 2022
Mar 6, 2023
Mar 6, 2023
Sep 15, 2022
Sep 15, 2022
Sep 15, 2022
Sep 15, 2022
Dec 10, 2022
Sep 4, 2022
Mar 22, 2023

Repository files navigation

Github Pilot

Logo

Make your Github CI processes fly.

Github pilot server

The primary point of the GH Pilot server is to define rules using a great, fluid API.

Rules are collections of predicates that trigger one or more actions when the predicate conditions match against incoming Github events.

  RuleBuilder::new("AutoLabel - Demo (add bar)")
      .when(PullRequest::labeled_with("T-foo"))
      .execute(Actions::github().add_label("T-bar").build())
      .submit(),

You can essentially perform any action when a rule's conditions are met. Even arbitrary code:

    let action = Actions::closure()
        .with(|_name, event| {
            let pr = event.pull_request().unwrap();
            let label = if let PullRequestAction::Unlabeled { label } = &pr.action {
                label.name.as_str()
            } else {
                "No label name found"
            };
            println!("PR #{} has had label [{}] removed.", pr.number, label)
        })
        .build();
    RuleBuilder::new("Print a message when a label is removed")
        .when(PullRequest::unlabeled())
        .execute(action)
        .submit()

Github pilot is far more flexible and easier to manage than Github Actions.

  • Automatically approve a PR if n "+1" comments are received from whitelisted users,
  • Automatically label PRs based on heuristics,
  • Trigger github actions based on fine-grained event predicates,
  • and much more

Github pilot CLI

The CLI tool is a handy partner client app to Github pilot. You can use it to do many of the things you do in the Github website, without having to leave your terminal.

  • Add a label to an issue
ghp-cli issue -n 123 add-label "T-foo"

..and so on. See ghp-cli --help for more.