workers-sdk icon indicating copy to clipboard operation
workers-sdk copied to clipboard

🚀 Feature Request: Get alias after `wrangler pages deploy`

Open paulk4633 opened this issue 2 years ago • 3 comments

Describe the solution

Currently, the wrangler pages deploy command just returns the URL of the current deployment and not the alias. Especially for very long branches > 28 characters, it's unpredictable how the alias will look like.

paulk4633 avatar Aug 08 '23 11:08 paulk4633

yes i need this as well. will be nice if we can access the alias via output step on github actions somehow

weiklr avatar Sep 29 '23 04:09 weiklr

+1

BenoitRichard1212 avatar Mar 04 '24 17:03 BenoitRichard1212

hi folks,

just to clarify... what is meant by alias here? The current format of the deployment URL is https://<sha>.<PROJECT_NAME>.pages.dev

CarmenPopoviciu avatar Jun 27 '24 14:06 CarmenPopoviciu

We haven't heard from you in while so I'm going to close this issue for now. If you're still running into problems feel free to comment with more details and we can investigate further.

penalosa avatar Jul 08 '24 13:07 penalosa

hi folks,

just to clarify... what is meant by alias here? The current format of the deployment URL is https://<sha>.<PROJECT_NAME>.pages.dev

@CarmenPopoviciu

"When a preview deployment is published, it is given a unique, hash-based address — for example, <hash>.<project>.pages.dev. These are atomic and may always be visited in the future. However, Pages also creates an alias for git branch’s name and updates it so that the alias always maps to the latest commit of that branch." (doc link)

See this example: image

I'd like this get the alias url from the wrangler pages deploy output too.

iulspop avatar Sep 04 '24 20:09 iulspop

wrangler pages deployment list also doesn't output this value, so I have no way of getting the alias url with wrangler.

iulspop avatar Sep 04 '24 20:09 iulspop

for now I'm running this command in my github action so I can get the url manually:

      - name: 🖨️ Print link to find preview alias URL
        run: echo "Find the preview alias here https://dash.cloudflare.com/accountid/workers-and-pages?type=pages"

iulspop avatar Sep 04 '24 20:09 iulspop

This is now available in Wrangler v3.78.0 -- to grep the alias you can do npx wrangler pages deploy <dir> | grep 'Deployment alias URL' | awk '{print $5}'

WalshyDev avatar Sep 13 '24 21:09 WalshyDev