Skip to content

Commit

Permalink
add additional_args to inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
Bai-Li-NOAA committed Nov 18, 2024
1 parent c973e34 commit 6a6feaf
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/r-cmd-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ on:
required: false
type: boolean
default: false
additional_args:
required: false
type: string
default: ""

name: R-CMD-check
jobs:
Expand Down
11 changes: 8 additions & 3 deletions R/use_r_workflows.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
use_r_cmd_check <- function(workflow_name = "call-r-cmd-check.yml",
use_full_build_matrix = FALSE,
depends_on_tmb = FALSE,
args = NULL) {
additional_args = NULL) {
check_workflow_name(workflow_name)
if (use_full_build_matrix) {
url_name <- "https://raw.githubusercontent.com/nmfs-fish-tools/ghactions4r/main/inst/templates/call-r-cmd-check-full.yml"
Expand All @@ -31,17 +31,22 @@ use_r_cmd_check <- function(workflow_name = "call-r-cmd-check.yml",
prev_line <- grep("use_full_build_matrix: true", txt, fixed = TRUE)
} else {
prev_line <- grep(
"uses: nmfs-fish-tools/ghactions4r/.github/workflows/r-cmd-check.yml@main",
"uses: nmfs-fish-tools/ghactions4r/.github/workflows/r-cmd-check.yml@add-input-option-workflows",
txt,
fixed = TRUE
)
# prev_line <- grep(
# "uses: nmfs-fish-tools/ghactions4r/.github/workflows/r-cmd-check.yml@main",
# txt,
# fixed = TRUE
# )
txt <- append(txt, " with:", prev_line)
prev_line <- prev_line + 1
}

if (depends_on_tmb) txt <- append(txt, " depends_on_tmb: true", prev_line)
if (!is.null(args)) {
txt <- append(txt, paste0(" ", args), prev_line)
txt <- append(txt, paste0(" ", additional_args), prev_line)
txt <- append(txt, " additional_args: ", prev_line)
}
writeLines(txt, path_to_yml)
Expand Down

0 comments on commit 6a6feaf

Please sign in to comment.