diff --git a/.github/workflows/generate-token-lists.yml b/.github/workflows/generate-token-lists.yml index 01aede87..2fa400d1 100644 --- a/.github/workflows/generate-token-lists.yml +++ b/.github/workflows/generate-token-lists.yml @@ -191,7 +191,7 @@ jobs: if: ${{ matrix.commands.version == true && matrix.commands.version == true }} run: | # Check if the list exists online (it will not exist on the first run) - if curl --silent --head --fail "https://tokenlist.arbitrum.io/ArbTokenLists/${{ matrix.commands.paths[0] }}"; then + if curl --silent --head --fail "https://tokenlist.arbitrum.io/${{ matrix.commands.paths[0] }}"; then # Get the version from the online list (formatted to major.minor.patch) version=$(curl https://tokenlist.arbitrum.io/${{ matrix.commands.paths[0] }} | jq .version | jq 'join(".")') if [[ -n $version ]]; then @@ -221,7 +221,10 @@ jobs: # Backup online list to {version}/{path} before deploying a new one lines=$(aws s3 ls s3://${{ secrets.AWS_BUCKET }}/$additionalPath$path | wc -l) if (( $lines > 0 )); then - aws s3 cp s3://${{ secrets.AWS_BUCKET }}/$additionalPath$path s3://${{ secrets.AWS_BUCKET }}/$additionalPath${{ steps.onlineVersion.outputs.onlineVersion }}/ + backupCommand="aws s3 cp s3://${{ secrets.AWS_BUCKET }}/$additionalPath$path s3://${{ secrets.AWS_BUCKET }}/$additionalPath" + backupCommand+=$(echo $path | awk -F'.json' '{print $1}') # Remove .json + backupCommand+=/${{ steps.onlineVersion.outputs.onlineVersion }}.json + $backupCommand fi done