Closed Ambroos closed 1 month ago
Since the lovely PR https://github.com/cloudflare/workers-sdk/pull/6643 that landed in Wrangler 3.78.0 it's now possible to get the deployment alias from the pages deploy output too.
pages deploy
This PR exposes that in a backwards compatible way. When there is no alias (or on older Wrangler versions) it'll just not be set.
I tested this in our local repo on commit https://github.com/Ambroos/wrangler-action/commit/6dcec6789d82c53bb800db578877e56cc81c2c45 (which contains dist) but is otherwise identical to this PR, and things seem very functional. Output below:
Run Ambroos/wrangler-action@6dcec6789d82c53bb800db578877e56cc8[1](snip#step:13:1)c2c45 with: wranglerVersion: 3.78.5 apiToken: *** accountId: *** workingDirectory: packages/snip command: pages deploy "snip" --project-name=snip --branch="ci/use-real-cf-preview-branch-url" --commit-message="ci: use real CF preview branch url" --commit-hash="snip" quiet: false env: PNPM_HOME: /home/runner/setup-pnpm/node_modules/.bin đ Checking for existing Wrangler installation /opt/hostedtoolcache/node/20.17.0/x64/bin/npx --no-install wrangler --version 3.78.5 â Using Wrangler 3.78.5 đ Running Wrangler Commands /opt/hostedtoolcache/node/20.17.0/x6[4](snip#step:13:4)/bin/npx wrangler pages deploy style-guide/build --project-name=ui --branch=ci/use-real-cf-preview-branch-url --commit-message=ci: use real CF preview branch url --commit-hash=snip Uploading... (5/5) ⨠Success! Uploaded 0 files (5 already uploaded) đ Deploying... ⨠Deployment complete! Take a peek over at https://abcdef.snip.pages.dev ⨠Deployment alias URL: https://ci-use-real-cf-preview-branc.snip.pages.dev đ Wrangler Action completed Run echo "### Deployed preview to Cloudflare Pages" >> $GITHUB_STEP_SUMMARY echo "### Deployed preview to Cloudflare Pages" >> $GITHUB_STEP_SUMMARY echo "đŠī¸ Preview URL: https://abcdef.snip.pages.dev" >> $GITHUB_STEP_SUMMARY echo "đŗ Branch URL: https://ci-use-real-cf-preview-branc.snip.pages.dev" >> $GITHUB_STEP_SUMMARY
Great work!
@Maximo-Guk Would you mind taking a peek? Thanks!
Thank you @Ambroos :)
@Maximo-Guk / @WalshyDev, can we have a new release which includes this, please? :slightly_smiling_face:
Since the lovely PR https://github.com/cloudflare/workers-sdk/pull/6643 that landed in Wrangler 3.78.0 it's now possible to get the deployment alias from the
pages deploy
output too.This PR exposes that in a backwards compatible way. When there is no alias (or on older Wrangler versions) it'll just not be set.
I tested this in our local repo on commit https://github.com/Ambroos/wrangler-action/commit/6dcec6789d82c53bb800db578877e56cc81c2c45 (which contains dist) but is otherwise identical to this PR, and things seem very functional. Output below: