From fef48fc9bf1e3f9a96a6971fe8ef6a27d59c9bd1 Mon Sep 17 00:00:00 2001 From: Val Gorodnichev Date: Wed, 16 Aug 2023 14:44:35 -0600 Subject: [PATCH] fix: tonumber --- pr-previews/cleanup/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pr-previews/cleanup/action.yml b/pr-previews/cleanup/action.yml index 6c7ec8c1..5fa3fbd6 100644 --- a/pr-previews/cleanup/action.yml +++ b/pr-previews/cleanup/action.yml @@ -32,7 +32,7 @@ runs: # get the list of the "-pr." published version for the packages pkgDetails=$(npm view "${pkgName}" --json) - prVersions=($(echo ${pkgDetails} | jq -r '.time' | jq -r 'to_entries' | jq --arg jq_oldestDate $oldestDate '[.[] | select(.value |.[0:19] +"Z" | fromdateiso8601 > $jq_oldestDate)]' | jq '[.[] | .key]'| grep "\-pr." | tac | sed 's/[,\"]//g')) + prVersions=$(echo ${pkgDetails} | jq -r '.time' | jq -r 'to_entries' | jq --arg jq_oldestDate ${oldestDate} '[.[] | select(.value |.[0:19] +"Z" | fromdateiso8601 > ($jq_oldestDate|tonumber))]' | jq '[.[] | .key]'| grep "\-pr." | tac | sed 's/[,\"]//g') if [[ -z "${prVersions}" ]]; then echo "No preview versions found, exiting..." exit 0