Skip to content

deployment-url output contains additional suffix and doesn't include protocol prefix #396

@buckett

Description

@buckett

When attempting to get the deployment URL it doesn't include the protocol prefix ( https:// ) and also includes additional text of (custom domain) on the end. This doesn't match what is currently documented in the README.md file.

Using a GitHub Action that includes:

        - uses: cloudflare/wrangler-action@v3
          id: wrangler
          with:
            wranglerVersion: "4.52.1"
            apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
            accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
        - name: print deployment-url
          env:
             DEPLOYMENT_URL: ${{ steps.wrangler.outputs.deployment-url }}
          run: echo $DEPLOYMENT_URL

the output is:

Run echo $DEPLOYMENT_URL
  echo $DEPLOYMENT_URL
  shell: /usr/bin/bash -e {0}
  env:
    DEPLOYMENT_URL: something.other.app (custom domain)
something.other.app (custom domain)

This isn't a big problem as but it would be helpful if the action either outputted a working URL with no suffix, or the plain domain name with no suffix.

A workaround is to just remove everything from the value once a whitespace is encountered, for example by piping the value through sed with a command like:

DEPLOYMENT_HOSTNAME=$( echo $DEPLOYMENT_URL  | sed 's/ .*//')
echo $DEPLOYMENT_HOSTNAME

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions