From 0513259ff9d6a4acb4e947d8cb113393dfe9fa99 Mon Sep 17 00:00:00 2001 From: Tom Parker-Shemilt Date: Fri, 30 Jul 2021 18:37:30 +0100 Subject: [PATCH] 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 --- CONTRIBUTING.md | 2 +- src/main.rs | 14 -------------- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 322cfc4..de95a5c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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: ` [](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. diff --git a/src/main.rs b/src/main.rs index 61d1873..e41ce9f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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;