github-actions 0.0.2

Utilities for developing custom GitHub Actions
Documentation
1
2
3
4
5
6
7
8
9
10
use std::env;

#[derive(Debug)]
pub enum StateResult {
    VarError(env::VarError),
}

pub fn get_state(name: &str) -> Result<String, StateResult> {
    env::var(format!("STATE_{}", name.to_uppercase())).map_err(|err| StateResult::VarError(err))
}