From 7c46fee7cf853a27164841ccc99a020976c05f7e Mon Sep 17 00:00:00 2001 From: cicdguy <26552821+cicdguy@users.noreply.github.com> Date: Fri, 15 Dec 2023 09:12:41 -0600 Subject: [PATCH 1/3] Fail URL checker if one or more bad URLs are found --- .github/workflows/urlchecker.yml | 7 +++++-- DESCRIPTION | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/urlchecker.yml b/.github/workflows/urlchecker.yml index 29b5eb1..19a5cfa 100644 --- a/.github/workflows/urlchecker.yml +++ b/.github/workflows/urlchecker.yml @@ -46,11 +46,14 @@ jobs: - name: Check for valid URLs run: | - urlchecker::url_check( + bad_urls <- nrow(print(urlchecker::url_check( path = ".", db = NULL, parallel = TRUE, pool = curl::new_pool(), progress = TRUE - ) + ))) + if (bad_urls > 0) { + stop("Looks like a total of ", bad_urls, " URL(s) were found! Please correct them.") + } shell: Rscript {0} diff --git a/DESCRIPTION b/DESCRIPTION index a5e1a76..18f6fd8 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: devops.toolkit -Title: What the Package Does (One Line, Title Case) +Title: An R package containing GitHub Actions workflows: https://httpbin.org/status/404 Version: 0.0.0.9000 -Authors@R: +Authors@R: person("First", "Last", , "first.last@example.com", role = c("aut", "cre"), comment = c(ORCID = "YOUR-ORCID-ID")) Description: What the package does (one paragraph). From e1a6f95267d5af4df843165a2ab89af2bfe1877e Mon Sep 17 00:00:00 2001 From: cicdguy <26552821+cicdguy@users.noreply.github.com> Date: Fri, 15 Dec 2023 09:18:13 -0600 Subject: [PATCH 2/3] Actually test with bad URL --- DESCRIPTION | 2 +- README.md | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 18f6fd8..e8f9acf 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: devops.toolkit -Title: An R package containing GitHub Actions workflows: https://httpbin.org/status/404 +Title: An R package containing GitHub Actions workflows. Version: 0.0.0.9000 Authors@R: person("First", "Last", , "first.last@example.com", role = c("aut", "cre"), diff --git a/README.md b/README.md index 4a151e6..9a9da18 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,5 @@ # devops-toolkit -Tools repository for DevOps + +Tools repository for DevOps. + +Click [here](https://github.com/insightsengineering/r.pkg.template/generate) to generate a copy of this template directly within GitHub. From 7d5e068ef7dcad384a7441dedfe8a3f17bee5c28 Mon Sep 17 00:00:00 2001 From: cicdguy <26552821+cicdguy@users.noreply.github.com> Date: Fri, 15 Dec 2023 09:20:21 -0600 Subject: [PATCH 3/3] Test succeeded, so undo change --- README.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/README.md b/README.md index 9a9da18..4a151e6 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,2 @@ # devops-toolkit - -Tools repository for DevOps. - -Click [here](https://github.com/insightsengineering/r.pkg.template/generate) to generate a copy of this template directly within GitHub. +Tools repository for DevOps