| Crates.io | gh_actions |
| lib.rs | gh_actions |
| version | 0.0.3 |
| created_at | 2022-08-01 21:23:47.766645+00 |
| updated_at | 2022-08-01 21:33:12.610492+00 |
| description | GitHub Actions Crate |
| homepage | https://github.com/GeekMasher/gh_actions |
| repository | https://github.com/GeekMasher/gh_actions |
| max_upload_size | |
| id | 637067 |
| size | 10,610 |
This is a Rust GitHub Actions library which should help those of us that write GitHub Actions in Rust.
Cargo.toml
[dependencies]
gh_actions = "0.0.2"
use gh_actions::GHAction;
fn main() {
let action = GHAction::new();
if action.in_action() {
// Name of your the Action
let action_name = action.name.unwrap()
println!(action_name)
// github.com or Enterprise Server
let api_url = action.get("api_url")
.unwrap();
// Get Actions Input
let username = action.get_input("username")
.unwrap();
// Using the Hubcaps client
let client = action.client
.unwrap();
let repo = client.repo("GeekMasher", "gh_actions");
}
Note: Do not use .unwrap() in a production Action.
This code is under the MIT License.