semver-common 1.2.0

Common library to use for semantic release core and plugins.
Documentation
pub mod github;

use r_log::Logger;
use serde::{Deserialize, Serialize};
use std::collections::HashMap;

use crate::Alert;

#[derive(Serialize, Deserialize, PartialEq, Debug)]
pub enum Auth {
    GITHUB,
    NONE,
}

impl Auth {
    /// Performs authentication with repository service based on which state Auth is.
    /// Supplies the environment variables from the running environment.
    pub fn authenticate(
        &self,
        env: &HashMap<String, String>,
        logger: &Logger,
    ) -> Result<(), Alert> {
        match self {
            Self::GITHUB => {
                github::set_remote(env, logger)?;
            }
            Self::NONE => {}
        }
        Ok(())
    }
}