GitHub Actions library written in Rust
This is a Rust GitHub Actions library which should help those of us that write GitHub Actions in Rust.
Installing
Cargo.toml
[dependencies]
ghactions = "0.1.0"
Usage
use ghactions::GHAction;
fn main() {
let action = GHAction::new();
if action.in_action() {
let action_name = action.name.unwrap();
println!(action_name);
let api_url = action.get("api_url")
.unwrap();
let username = action.get_input("username")
.unwrap();
let client = action.client
.unwrap();
let repo = client.repo("GeekMasher", "gh_actions");
}
}
Note: Do not use .unwrap() in a production Action.
License
This code is under the MIT License.