-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: add overview documentation (#7)
- Loading branch information
Showing
4 changed files
with
81 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.