fn github_ref_version() -> Result<Version> {
    let version = match env::var("GITHUB_REF") {
        Ok(version) => version,
        _ => bail!("missing: GITHUB_REF"),
    };

    let mut it = version.split('/');

    let version = match (it.next(), it.next(), it.next()) {
        (Some("refs"), Some("tags"), Some(version)) => {
            Version::open(version)?.ok_or_else(|| anyhow!("Expected valid version"))?
        }
        _ => bail!("expected GITHUB_REF: refs/tags/*"),
    };

    Ok(version)
}
/// Get the version from GITHUB_REF.
Get the version from GITHUB_REF.
Get the version from GITHUB_REF .
fn github_ref_version() -> Result<Version> {
    let version = match env::var("GITHUB_REF") {
        Ok(version) => version,
        _ => bail!("missing: GITHUB_REF"),
    };
    let mut it = version.split('/');
    let version = match (it.next(), it.next(), it.next()) {
        (Some("refs"), Some("tags"), Some(version)) => {
            Version::open(version)?.ok_or_else(|| anyhow!("Expected valid version"))?
        }
        _ => bail!("expected GITHUB_REF: refs/tags/*"),
    };
    Ok(version)
}
fn github_ref_version ( ) -> Result < Version > { let version = match env :: var ( " " ) { Ok ( version ) => version , _ => bail ! ( " " ) , } ; let mut it = version . split ( '/' ) ; let version = match ( it . next ( ) , it . next ( ) , it . next ( ) ) { ( Some ( " " ) , Some ( " " ) , Some ( version ) ) => { Version :: open ( version ) ? . ok_or_else ( | | anyhow ! ( " " ) ) ? } _ => bail ! ( " " ) , } ; Ok ( version ) }
Get the version from GITHUB_REF.
Get the version from GITHUB_REF .