Skip to content

Commit

Permalink
feat: Simulate failure and try uninstall step
Browse files Browse the repository at this point in the history
  • Loading branch information
fmarek-kindred committed Oct 23, 2023
1 parent ff5ffb7 commit c3ab8d1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions scripts/cohort/github-actions-ci/unpublish-sdk-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ npm version
echo "Unpublishing faulty version: $unpublishVersion"
allVersionsArray=$(curl -L -H "Accept: application/vnd.github+json" -H "Authorization: Bearer $NODE_AUTH_TOKEN" -H "X-GitHub-Api-Version: $API_VERSION" "$API_URL/$packageName/versions")
echo $allVersionsArray > ./tmp_all_versions.json
lookupPackageVersionId=$(echo "$allVersionsArray" | yq '.[] | select(.name=="$versionName") | .id')
lookupPackageVersionId=$(echo "$allVersionsArray" | jq --arg versionName="$versionName" '.[] | select(.name == $versionName) | .id')
if [ "$lookupPackageVersionId" == "" ];
then
echo "E: Unable to find package version id"
Expand All @@ -41,14 +41,14 @@ then

echo ""
echo "D: echo allVersionsArray | yq .[]"
echo "$allVersionsArray" | yq '.[]'
echo "$allVersionsArray" | jq '.[]'
echo ""
echo "D: versionName=$versionName"
echo "D: echo allVersionsArray | yq .[] | select(.name==versionName)"
echo "$allVersionsArray" | yq '.[] | select(.name=="$versionName")'
echo "D: echo allVersionsArray | yq .[] | select(.name == versionName)"
echo "$allVersionsArray" | jq --arg versionName="$versionName" '.[] | select(.name == $versionName)'
echo ""
echo "D: full yq command result"
echo "$allVersionsArray" | yq '.[] | select(.name=="$versionName") | .id'
echo "$allVersionsArray" | jq --arg versionName="$versionName" '.[] | select(.name == $versionName) | .id'

rm ./tmp_all_versions.json
echo ""
Expand Down

0 comments on commit c3ab8d1

Please sign in to comment.