@@ -42,36 +42,71 @@ use_badge_travis <- function(repo = NULL, user = "KWB-R")
4242 )
4343}
4444
45- # use_badge_ghactions ---------- ------------------------------------------------
45+ # use_badge_ghactions_rcmdcheck ------------------------------------------------
4646
47- # ' Badge Github Actions
47+ # ' Badge Github Actions RCMD Check
4848# ' @param repo name of repository (default: NULL)
4949# ' @param user user name or organisation under which repository defined in
5050# ' parameter "repo" is hosted (default: KWB-R")
51+ # ' @param branch default: NULL (i.e. use "default" branch) or user defined branch
52+ # ' (e.g. "dev")
5153# ' @return generates travis badge link
5254# ' @export
53- use_badge_ghactions <- function (repo = NULL , user = " KWB-R" )
55+ use_badge_ghactions_rcmdcheck <- function (repo = NULL , user = " KWB-R" ,
56+ branch = NULL )
5457{
55- sprintf(" %s\n %s" ,
56-
5758 kwb.utils :: resolve(
5859 " url" ,
5960 grammars $ general ,
6061 grammars $ ghactions_rcmdcheck ,
6162 user = user ,
62- pkgname = get_pkgname(repo )
63- ),
63+ pkgname = get_pkgname(repo ),
64+ params = ifelse(is.null(branch ), " " , sprintf(" ?branch=%s" , branch ))
65+
66+ )
67+
68+ }
69+
70+ # ' Badge Github Actions Pkgdown
71+ # ' @param repo name of repository (default: NULL)
72+ # ' @param user user name or organisation under which repository defined in
73+ # ' parameter "repo" is hosted (default: KWB-R")
74+ # ' @param branch default: NULL (i.e. use "default" branch) or user defined branch
75+ # ' (e.g. "dev")
76+ # ' @return generates Github Actions Pkgdown badge link
77+ # ' @export
78+ use_badge_ghactions_pkgdown <- function (repo = NULL , user = " KWB-R" , branch = NULL )
79+ {
6480 kwb.utils :: resolve(
6581 " url" ,
6682 grammars $ general ,
6783 grammars $ ghactions_pkgdown ,
6884 user = user ,
69- pkgname = get_pkgname(repo )
70- )
85+ pkgname = get_pkgname(repo ),
86+ params = ifelse(is.null( branch ), " " , sprintf( " ?branch=%s " , branch ) )
7187 )
7288
7389}
7490
91+ # use_badge_ghactions ----------------------------------------------------------
92+
93+ # ' Badge Github Actions
94+ # ' @param repo name of repository (default: NULL)
95+ # ' @param user user name or organisation under which repository defined in
96+ # ' parameter "repo" is hosted (default: KWB-R")
97+ # ' @param branch default: NULL (i.e. use "default" branch) or user defined branch
98+ # ' (e.g. "dev")
99+ # ' @return generates Github Actions badges link
100+ # ' @export
101+ use_badge_ghactions <- function (repo = NULL , user = " KWB-R" , branch = NULL )
102+ {
103+ sprintf(" %s\n %s" ,
104+ use_badge_ghactions_rcmdcheck(repo , user , branch ),
105+ use_badge_ghactions_pkgdown(repo , user , branch )
106+ )
107+ }
108+
109+
75110# use_badge_codecov ------------------------------------------------------------
76111
77112# ' Badge codecov
0 commit comments