ghactions 0.2.0

GitHub Actions Crate
Documentation

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() {
        // 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.