Skip to content

Commit 97d1218

Browse files
olivroyjennybc
andauthored
Add badge when updating coverage action (#2009)
* Add badge when updating coverage action * Tweaks --------- Co-authored-by: Jenny Bryan <[email protected]>
1 parent 5cde0da commit 97d1218

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

R/github-actions.R

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,12 @@ use_github_action <- function(name = NULL,
124124
ui_bullets(c("_" = "Learn more at {.url {readme}}."))
125125
}
126126

127-
badge <- badge %||% is_check_action(url)
128-
if (badge) {
127+
if (badge %||% is_check_action(url)) {
129128
use_github_actions_badge(path_file(save_as))
130129
}
130+
if (badge %||% is_coverage_action(url)) {
131+
use_codecov_badge(target_repo_spec())
132+
}
131133

132134
invisible(new)
133135
}
@@ -167,6 +169,10 @@ is_check_action <- function(url) {
167169
grepl("^check-", path_file(url))
168170
}
169171

172+
is_coverage_action <- function(url) {
173+
grepl("test-coverage", path_file(url))
174+
}
175+
170176
#' Generates a GitHub Actions badge
171177
#'
172178
#' Generates a GitHub Actions badge and that's all. This exists primarily for

0 commit comments

Comments
 (0)