|
|
|
@ -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' |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
" |
|
|
|
|
|
|
|
|