gh_actions

Crates.iogh_actions
lib.rsgh_actions
version0.0.3
sourcesrc
created_at2022-08-01 21:23:47.766645
updated_at2022-08-01 21:33:12.610492
descriptionGitHub Actions Crate
homepagehttps://github.com/GeekMasher/gh_actions
repositoryhttps://github.com/GeekMasher/gh_actions
max_upload_size
id637067
size10,610
Mathew Payne (GeekMasher)

documentation

https://github.com/GeekMasher/gh_actions

README

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]
gh_actions = "0.0.2"

Usage

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.

License

This code is under the MIT License.

Commit count: 33

cargo fmt