pub const PARSEC_JIRA_TOKEN: &str = "PARSEC_JIRA_TOKEN";
pub const JIRA_PAT: &str = "JIRA_PAT";
pub const JIRA_BASE_URL: &str = "JIRA_BASE_URL";
pub const PARSEC_JIRA_PROJECT: &str = "PARSEC_JIRA_PROJECT";
pub const PARSEC_JIRA_BOARD_ID: &str = "PARSEC_JIRA_BOARD_ID";
pub const PARSEC_JIRA_ASSIGNEE: &str = "PARSEC_JIRA_ASSIGNEE";
pub const PARSEC_GITHUB_TOKEN: &str = "PARSEC_GITHUB_TOKEN";
pub const GITHUB_TOKEN: &str = "GITHUB_TOKEN";
pub const GH_TOKEN: &str = "GH_TOKEN";
pub const PARSEC_GITLAB_TOKEN: &str = "PARSEC_GITLAB_TOKEN";
pub const GITLAB_TOKEN: &str = "GITLAB_TOKEN";
pub fn jira_token() -> Option<String> {
for var in [PARSEC_JIRA_TOKEN, JIRA_PAT] {
if let Ok(token) = std::env::var(var) {
if !token.is_empty() {
return Some(token);
}
}
}
None
}
pub fn github_token() -> Option<String> {
for var in [PARSEC_GITHUB_TOKEN, GITHUB_TOKEN, GH_TOKEN] {
if let Ok(token) = std::env::var(var) {
if !token.is_empty() {
return Some(token);
}
}
}
None
}
pub fn gitlab_token() -> Option<String> {
for var in [PARSEC_GITLAB_TOKEN, GITLAB_TOKEN] {
if let Ok(token) = std::env::var(var) {
if !token.is_empty() {
return Some(token);
}
}
}
None
}