Realised that the Github actions default to the default branch for a repo

(unlike Travis) and so the branch error isn't needed any more
pull/1034/head^2
Tom Parker-Shemilt 3 years ago
parent 757b3fba39
commit 0513259ff9

@ -15,7 +15,7 @@ If you want to add an entry to the `README.md` please consider this:
* if you've not published your crate to `crates.io` remove the `[[CRATE](...)]` part.
* if you have a CI build, please add the build badge. Put the image after the description, separated by a space. Please make sure to add the branch information to the image:
* example for Travis: ` [<img src="https://api.travis-ci.org/XXX/CRATE.svg?branch=master">](https://travis-ci.org/XXX/CRATE)`
* for Github actions please see https://docs.github.com/en/free-pro-team@latest/actions/managing-workflow-runs/adding-a-workflow-status-badge#using-the-branch-parameter
* for Github actions please see https://docs.github.com/en/actions/managing-workflow-runs/adding-a-workflow-status-badge
- please pay attention to the alphabetical ordering.

@ -39,9 +39,6 @@ enum CheckerError {
#[fail(display = "travis build image with no branch")]
TravisBuildNoBranch,
#[fail(display = "github actions image with no branch")]
GithubActionNoBranch,
}
fn formatter(err: &CheckerError, url: &String) -> String {
@ -62,9 +59,6 @@ fn formatter(err: &CheckerError, url: &String) -> String {
CheckerError::TravisBuildNoBranch => {
format!("[Travis build image with no branch specified] {}", url)
}
CheckerError::GithubActionNoBranch => {
format!("[Github action image with no branch specified] {}", url)
}
_ => {
format!("{:?}", err)
}
@ -227,14 +221,6 @@ fn get_url_core(url: String) -> BoxFuture<'static, (String, Result<(), CheckerEr
break;
}
}
if let Some(matches) = GITHUB_ACTIONS_REGEX.captures(&url) {
debug!("Github actions match {:?}", matches);
let query = matches.get(1).map(|x| x.as_str()).unwrap_or("");
if !query.starts_with("?") || query.find("branch=").is_none() {
res = Err(CheckerError::GithubActionNoBranch);
break;
}
}
debug!("Finished {}", url);
res = Ok(());
break;

Loading…
Cancel
Save