GHActions

A Rust library for helping write GitHub Actions with type-safe interfaces and ergonomic APIs.

Rust Rust GitHub Actions CI/CD DevOps
GHActions

GHActions

A Rust library that makes writing GitHub Actions easier with type-safe interfaces and ergonomic APIs.

Features

  • Type-Safe: Strongly typed GitHub Actions interfaces
  • Easy to Use: Simple, intuitive API design
  • Complete: Support for all GitHub Actions features
  • Well Documented: Comprehensive docs and examples
  • Production Ready: Battle-tested in real-world workflows

Getting Started

Add GHActions to your Cargo.toml:

[dependencies]
ghactions = "0.1"

Example Usage

use ghactions::{Context, Input, Output};

fn main() -> Result<(), Box<dyn std::error::Error>> {
    // Get action inputs
    let input_value = Input::new("my-input")
        .required(true)
        .get()?;
    
    // Access GitHub context
    let ctx = Context::current()?;
    println!("Repository: {}", ctx.repository);
    println!("Actor: {}", ctx.actor);
    
    // Set action outputs
    Output::new("result")
        .set("success")?;
    
    Ok(())
}

Why GHActions?

  • Type Safety: Catch errors at compile time, not runtime
  • Developer Experience: Ergonomic API that feels natural
  • Zero Overhead: Minimal runtime cost
  • Comprehensive: Full GitHub Actions API coverage

Use Cases

  • Building custom GitHub Actions in Rust
  • Creating reusable action components
  • Writing type-safe CI/CD workflows
  • Automating GitHub workflows with confidence