Skip to content

Commit 3b6322b

Browse files
committed
fix items that were not working
1 parent 0aec5e1 commit 3b6322b

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

R/check_changes_for_autoapproval.R

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,32 +50,33 @@ check_changes_for_autoapproval <- function(
5050
dplyr::filter(!.data$in_model_output) |>
5151
dplyr::pull(.data$full_path)
5252

53-
if (nrow(files_outside_model_output) > 0) {
53+
if (length(files_outside_model_output) > 0) {
5454
cli::cli_abort(
5555
c(
5656
"Auto-approval failed: Changes detected outside 'model-output' directory.",
5757
"The following files are outside 'model-output':",
5858
files_outside_model_output
5959
)
6060
)
61-
changed_model_ids <- changed_files_tbl |>
61+
}
6262

6363
# extract unique model IDs
64-
changed_dirs <- changed_files_tbl |>
64+
changed_model_ids <- changed_files_tbl |>
65+
6566
dplyr::filter(.data$in_model_output) |>
66-
if (nrow(changed_model_ids) == 0) {
67+
dplyr::pull(.data$model_id) |>
6768
unique()
6869

6970
# only check authorization if there are model directories
70-
if (length(changed_dirs) > 0) {
71+
if (length(changed_model_ids) > 0) {
7172
cli::cli_inform(
72-
"Checking authorization for {length(changed_dirs)} model director{?y/ies}: {.val {changed_dirs}}"
73+
"Checking authorization for {length(changed_model_ids)} model director{?y/ies}: {.val {changed_model_ids}}"
7374
)
7475

7576
# pass model IDs to check_authorized_users
7677
check_authorized_users(
77-
changed_dirs = changed_dirs,
78-
changed_dirs = changed_model_ids,
78+
changed_dirs = changed_model_ids,
79+
gh_actor = gh_actor,
7980
base_hub_path = base_hub_path
8081
)
8182
}

0 commit comments

Comments
 (0)