From 69167c9cf7dfacc195a2d4caa2bff2de0ba6c136 Mon Sep 17 00:00:00 2001 From: Subekshya Bidari <37636707+sbidari@users.noreply.github.com> Date: Wed, 20 Nov 2024 09:40:31 -0700 Subject: [PATCH] Update update-authorized-users.yaml (#50) * Update update-authorized-users.yaml * add colon * add text file * fix typo --- .github/workflows/update-authorized-users.yaml | 2 +- auxiliary-data/authorized_users.txt | 1 + src/code/get_authorized_users.r | 7 +++---- 3 files changed, 5 insertions(+), 5 deletions(-) create mode 100644 auxiliary-data/authorized_users.txt diff --git a/.github/workflows/update-authorized-users.yaml b/.github/workflows/update-authorized-users.yaml index e7802cb..ad49442 100644 --- a/.github/workflows/update-authorized-users.yaml +++ b/.github/workflows/update-authorized-users.yaml @@ -33,7 +33,7 @@ jobs: - name: Check for Changes id: check_diff run: | - git diff --exit-code auxiliary-data/authorized_users.txt || echo "changed=true" >> $GITHUB_ENV + git diff --exit-code auxiliary-data/authorized_users.txt || { echo "changed=true" | tee -a $GITHUB_ENV; } - name: Commit changes if: env.changed == 'true' diff --git a/auxiliary-data/authorized_users.txt b/auxiliary-data/authorized_users.txt new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/auxiliary-data/authorized_users.txt @@ -0,0 +1 @@ + diff --git a/src/code/get_authorized_users.r b/src/code/get_authorized_users.r index a9cb5c2..42756dc 100644 --- a/src/code/get_authorized_users.r +++ b/src/code/get_authorized_users.r @@ -1,4 +1,3 @@ - hub_path <- "." output_path <- "auxiliary-data/" @@ -13,8 +12,8 @@ extract_metadata <- function(file) { "model_abbr" %in% names(yml_data), yml_data$model_abbr, NA ) designated_user <- ifelse( - "designated_github_user" %in% names(yml_data), - paste(yml_data$designated_github_user, collapse = ", "), + "designated_github_users" %in% names(yml_data), + paste(yml_data$designated_github_users, collapse = ", "), NA ) @@ -33,4 +32,4 @@ output <- glue::glue( "{data_df$team_name}-{data_df$model_name} {data_df$designated_users}" ) -writeLines(output, file.path(output_path, "authorized_users.txt")) \ No newline at end of file +writeLines(output, file.path(output_path, "authorized_users.txt"))