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 c3ab8d1 commit f1a45f3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/npm_publish_light.yml
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,9 @@ jobs:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |-
cd ${{ matrix.settings.dirSdkJsClient }}
../scripts/cohort/github-actions-ci/unpublish-sdk-version.sh "$SDK_CLIENT_PACKAGE_NAME" "$SDK_CLIENT_PACKAGE_VERSION"
../scripts/cohort/github-actions-ci/unpublish-sdk-version.sh "$SDK_CLIENT_PACKAGE_NAME_SHORT" "$SDK_CLIENT_PACKAGE_VERSION"
echo ""
cd ${{ matrix.settings.dirSdkJs }}
../../scripts/cohort/github-actions-ci/unpublish-sdk-version.sh "$SDK_JS_PACKAGE_NAME" "$SDK_JS_PACKAGE_VERSION"
../../scripts/cohort/github-actions-ci/unpublish-sdk-version.sh "$SDK_JS_PACKAGE_NAME_SHORT" "$SDK_JS_PACKAGE_VERSION"
echo ""
6 changes: 3 additions & 3 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" | jq --arg versionName="$versionName" '.[] | 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 @@ -45,10 +45,10 @@ then
echo ""
echo "D: versionName=$versionName"
echo "D: echo allVersionsArray | yq .[] | select(.name == versionName)"
echo "$allVersionsArray" | jq --arg versionName="$versionName" '.[] | select(.name == $versionName)'
echo "$allVersionsArray" | jq --arg versionName "$versionName" '.[] | select(.name == $versionName)'
echo ""
echo "D: full yq command result"
echo "$allVersionsArray" | jq --arg versionName="$versionName" '.[] | 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 f1a45f3

Please sign in to comment.