Browse Source

Update the 'update-rebrandly-link' action (#34)

pull/35/head
Vince Grassia 4 years ago committed by GitHub
parent
commit
340a677ffb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 13
      update-rebrandly-link/action.yml

13
update-rebrandly-link/action.yml

@ -33,10 +33,10 @@ runs:
DOMAIN: ${{ inputs.domain }} DOMAIN: ${{ inputs.domain }}
SLASHTAG: ${{ inputs.slashtag }} SLASHTAG: ${{ inputs.slashtag }}
run: | run: |
ID=$(curl --request GET \ ID=$(curl --silent --request GET \
--url "https://api.rebrandly.com/v1/links?domain.fullName=$DOMAIN&slashtag=$SLASHTAG" \ --url "https://api.rebrandly.com/v1/links?domain.fullName=$DOMAIN&slashtag=$SLASHTAG" \
--header "Accept: application/json" \ --header "Accept: application/json" \
--header "apikey: $APIKEY" | jq '.[0].id') --header "apikey: $APIKEY" | jq -r '.[0].id')
echo "::set-output name=id::$ID" echo "::set-output name=id::$ID"
- name: Update Link Destination - name: Update Link Destination
@ -46,13 +46,10 @@ runs:
ID: ${{ steps.get-link-id.outputs.id }} ID: ${{ steps.get-link-id.outputs.id }}
DESTINATION: ${{ inputs.destination }} DESTINATION: ${{ inputs.destination }}
run: | run: |
curl --request POST \ RESULT=$(curl --silent --request POST \
--url https://api.rebrandly.com/v1/links/$ID \ --url https://api.rebrandly.com/v1/links/$ID \
--header "Accept: application/json" \ --header "Accept: application/json" \
--header "Content-Type: application/json" \ --header "Content-Type: application/json" \
--header "apikey: $APIKEY" \ --header "apikey: $APIKEY" \
--data " --data "{\"destination\": \"$DESTINATION\"}")
{ echo $RESULT | jq '.shortUrl, .destination, .updatedAt'
'destination': '$DESTINATION'
}
"

Loading…
Cancel
Save