From 340a677ffb0c53e50ca67cd2c12044cd7f7fc725 Mon Sep 17 00:00:00 2001 From: Vince Grassia <593223+vgrassia@users.noreply.github.com> Date: Tue, 1 Mar 2022 13:22:20 -0500 Subject: [PATCH] Update the 'update-rebrandly-link' action (#34) --- update-rebrandly-link/action.yml | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/update-rebrandly-link/action.yml b/update-rebrandly-link/action.yml index 438526e8..bd886afc 100644 --- a/update-rebrandly-link/action.yml +++ b/update-rebrandly-link/action.yml @@ -33,10 +33,10 @@ runs: DOMAIN: ${{ inputs.domain }} SLASHTAG: ${{ inputs.slashtag }} run: | - ID=$(curl --request GET \ + ID=$(curl --silent --request GET \ --url "https://api.rebrandly.com/v1/links?domain.fullName=$DOMAIN&slashtag=$SLASHTAG" \ --header "Accept: application/json" \ - --header "apikey: $APIKEY" | jq '.[0].id') + --header "apikey: $APIKEY" | jq -r '.[0].id') echo "::set-output name=id::$ID" - name: Update Link Destination @@ -46,13 +46,10 @@ runs: ID: ${{ steps.get-link-id.outputs.id }} DESTINATION: ${{ inputs.destination }} run: | - curl --request POST \ + RESULT=$(curl --silent --request POST \ --url https://api.rebrandly.com/v1/links/$ID \ --header "Accept: application/json" \ --header "Content-Type: application/json" \ --header "apikey: $APIKEY" \ - --data " - { - 'destination': '$DESTINATION' - } - " + --data "{\"destination\": \"$DESTINATION\"}") + echo $RESULT | jq '.shortUrl, .destination, .updatedAt'