From af00355fd376da62f53eb6e5b569e11a8047b294 Mon Sep 17 00:00:00 2001 From: Val Gorodnichev Date: Thu, 17 Aug 2023 07:23:05 -0600 Subject: [PATCH] fix: do not attempt to proceed already removed version [KHCP-7885] --- pr-previews/cleanup/action.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pr-previews/cleanup/action.yml b/pr-previews/cleanup/action.yml index 6a3b989e..f5c9fc6f 100644 --- a/pr-previews/cleanup/action.yml +++ b/pr-previews/cleanup/action.yml @@ -47,6 +47,11 @@ runs: echo " " echo "$((current++))/${total}" + if [[ -z "$(echo ${pkgDetails} | jq -r '.versions'|grep ${verToRemove})" ]]; then + echo "Version already removed, skip..." + continue + fi + verDetails=$(npm view "${pkgName}@${verToRemove}" --json) # validate that the version doesn't belong to open PR