From fba175d7e47c62d3487f328dcb2463ecff3c25d2 Mon Sep 17 00:00:00 2001 From: buidav <105074908+buidav@users.noreply.github.com> Date: Tue, 1 Oct 2024 17:04:06 -0700 Subject: [PATCH] update workflow to handle single version case --- .github/workflows/run_update_opa.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/run_update_opa.yaml b/.github/workflows/run_update_opa.yaml index 56a9c68984..299cef438c 100644 --- a/.github/workflows/run_update_opa.yaml +++ b/.github/workflows/run_update_opa.yaml @@ -119,6 +119,12 @@ jobs: # Then add the new version on the next line ($VersionsArr[0..($VersionsArr.Length-2)] -join ",") + "," " '$CurrentOPAVersion', $DefaultOPAVersionVar $END_VERSIONS_COMMENT" # 4 space indentation + } + elseif ($VersionsLength -eq 1) { + # if the default version is the only acceptable version + # Make `VariableName = CurrentVersion, Default #EndVersionComment ` + $VersionsArr = $_ -split "=" + $VersionsArr[0] + " = '$CurrentOPAVersion'" + ", $DefaultOPAVersionVar $END_VERSIONS_COMMENT" } else { # No Splitting lines; Appending new Current OPA version to acceptable version