Skip to content

Commit

Permalink
add: check for nightly rollback
Browse files Browse the repository at this point in the history
  • Loading branch information
MordechaiHadad committed Dec 31, 2023
1 parent 636ec32 commit 4bfe659
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/handlers/list_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,21 @@ fn is_version(name: &str) -> bool {
return true;
}

hash_regex.is_match(name)
if hash_regex.is_match(name) {
return true;
}

let alphanumeric_regex = Regex::new(r"^[a-zA-Z0-9]{8}$").unwrap();
let separated_version: Vec<&str> = name.split('-').collect();

if separated_version[0] == "nightly"
&& (hash_regex.is_match(separated_version[1])
|| alphanumeric_regex.is_match(separated_version[1]))
{
return true;
}

false
}
}
}

0 comments on commit 4bfe659

Please sign in to comment.