Skip to content

Commit

Permalink
docs: add overview documentation (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
CjS77 authored Sep 15, 2022
1 parent 7f96d9f commit 842a508
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 1 deletion.
21 changes: 21 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Copyright 2022. The Tari Development Community

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following
disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the
following disclaimer in the documentation and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
59 changes: 59 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Github Pilot

![Logo](./gh_pilot_logo.jpg)

_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.

```rust
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:

```rust
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

```bash
ghp-cli issue -n 123 add-label "T-foo"
```

..and so on. See `ghp-cli --help` for more.
2 changes: 1 addition & 1 deletion cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "ghp-cli"
version = "0.1.0"
edition = "2021"

description = "A command line interface for GitHub Pages; intended as a client partner tool to the Github Pilot server"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
Expand Down
Binary file added gh_pilot_logo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 842a508

Please sign in to comment.