[mirror] Opinionated R package quickstart
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #5 from VisruthSK/coverage-GHA-changes

Swap coverage action to use OIDC

authored by

Visruth Srimath Kandali and committed by
GitHub
44f2cf4b d7eaef50

+38
+11
R/bootstrapper.R
··· 184 184 setup_gha <- function() { 185 185 usethis::use_github_action("check-standard", badge = TRUE) 186 186 usethis::use_github_action("test-coverage") 187 + # swap from codecov tokens to OICD 188 + find_replace_in_file( 189 + "token: ${{ secrets.CODECOV_TOKEN }}", 190 + "use_oidc: true", 191 + fs::path(".github", "workflows", "test-coverage.yaml") 192 + ) 193 + find_replace_in_file( 194 + "permissions: read-all", 195 + "permissions:\n contents: read\n id-token: write", 196 + fs::path(".github", "workflows", "test-coverage.yaml") 197 + ) 187 198 usethis::use_github_action( 188 199 url = "https://github.com/visruthsk/bootstrapper/blob/main/.github/workflows/format-suggest.yaml" 189 200 )
+27
tests/testthat/test-bootstrapper.R
··· 244 244 actions <- list( 245 245 github_actions = list(), 246 246 replacements = character(), 247 + workflow_replacements = character(), 247 248 spell = FALSE, 248 249 air = FALSE, 249 250 writes = character() ··· 274 275 ) 275 276 NULL 276 277 }, 278 + find_replace_in_file = function(from, to, file, fixed = TRUE) { 279 + actions$workflow_replacements <<- c( 280 + actions$workflow_replacements, 281 + paste(from, to, file, fixed, sep = " -> ") 282 + ) 283 + NULL 284 + }, 277 285 copy_template_file = function(template_file, destination) { 278 286 actions$writes <<- c(actions$writes, destination) 279 287 expect_true(template_file %in% c("extensions.json", "jarl.toml")) ··· 298 306 "actions/checkout@v4 -> actions/checkout@v6", 299 307 "actions/upload-artifact@v4 -> actions/upload-artifact@v6", 300 308 "JamesIves/github-pages-deploy-action@v4.5.0 -> JamesIves/github-pages-deploy-action@v4" 309 + ) 310 + ) 311 + expect_identical( 312 + actions$workflow_replacements, 313 + c( 314 + paste( 315 + "token: ${{ secrets.CODECOV_TOKEN }}", 316 + "use_oidc: true", 317 + fs::path(".github", "workflows", "test-coverage.yaml"), 318 + "TRUE", 319 + sep = " -> " 320 + ), 321 + paste( 322 + "permissions: read-all", 323 + "permissions:\n contents: read\n id-token: write", 324 + fs::path(".github", "workflows", "test-coverage.yaml"), 325 + "TRUE", 326 + sep = " -> " 327 + ) 301 328 ) 302 329 ) 303 330 expect_true(actions$air)