Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

versions commands do not set deployment-url #343

Open
gferreri opened this issue Jan 14, 2025 · 2 comments · May be fixed by #348
Open

versions commands do not set deployment-url #343

gferreri opened this issue Jan 14, 2025 · 2 comments · May be fixed by #348

Comments

@gferreri
Copy link

When using the action with a command to upload a version (and preview URLs are enabled), the action's deployment-url output is not set.

Example Step

- name: Deploy Test Report to Cloudflare
        if: always()
        id: deploy-to-cloudflare
        uses: cloudflare/wrangler-action@v3
        with:
          accountId: ${{secrets.CLOUDFLARE_ACCOUNT_ID}}
          apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
          workingDirectory: ./apps/my-app
          command: versions upload -c wrangler.test-report.json

 - name: Get deployment URL
        if: always()
        id: get-deployment-url
        run: |
          set -x
          echo "url=${{ steps.deploy-to-cloudflare.outputs.deployment-url  }}" >> "$GITHUB_OUTPUT"

Output

Run cloudflare/wrangler-action@v3
/usr/bin/docker exec  804a57670ad65f72e1537be4fdc519444a548e2523b68ab626f5c41ca196ea1d sh -c "cat /etc/*release | grep ^ID"
🔍 Checking for existing Wrangler installation
  /__t/node/20.10.0/x64/bin/npx --no-install wrangler --version
  3.102.0
  ✅ No wrangler version specified, using pre-installed wrangler version 3.102.0

🚀 Running Wrangler Commands
  /__t/node/20.10.0/x64/bin/npx wrangler versions upload -c wrangler.test-report.json
  
   ⛅️ wrangler 3.102.0
  --------------------
  
  🌀 Building list of assets...
  🌀 Starting asset upload...
  🌀 Found 7 new or modified static assets to upload. Proceeding with upload...
  + /data/3a0c226d[11](https://github.com/xxx/External.Frontend/actions/runs/12777465257/job/35618312204#step:13:12)ecbbe01954a623ddbd2e6a9b5e4d3d.webm
  + /index.html
  + /data/4aca4b57288f7e3de5063b3cc15221f42a925f88.zip
  + /data/a606f64154803ab67728381defc4a8a104f1b6a0.webm
  + /data/d8caac46bdd4ff93091c002c783eab03a2e1848b.zip
  + /data/410258399721821f643a023c1644329d1b1e52ad.webm
  + /data/b6e9f82f2a0e440eabb27ba5[12](https://github.com/xxx/yyy/actions/runs/12777465257/job/35618312204#step:13:13)4a9e27d46d2f56.zip
  Uploaded 3 of 7 assets
  Uploaded 5 of 7 assets
  Uploaded 7 of 7 assets
  ✨ Success! Uploaded 7 files (20 already uploaded) (3.50 sec)
  
  Total Upload: 27.49 KiB / gzip: 6.34 KiB
  Worker Startup Time: 0 ms
  Uploaded frontend-test-reports (5.54 sec)
  Worker Version ID: 831b41cb-056f-48ff-819e-03418[16](https://github.com/xxx/xxx/actions/runs/12777465257/job/35618312204#step:13:18)0224f
  Version Preview URL: https://831b41cb-xxxx.xxx.workers.dev
  
  To deploy this version to production traffic use the command wrangler versions deploy
  
  Changes to non-versioned settings (config properties 'logpush' or 'tail_consumers') take effect after your next deployment using the command wrangler versions deploy
  
  Changes to triggers (routes, custom domains, cron schedules, etc) must be applied with the command wrangler triggers deploy
  
🏁 Wrangler Action completed
0s

[Get deployment URL step]

Run echo "url=" >> "$GITHUB_OUTPUT"
  echo "url=" >> "$GITHUB_OUTPUT"
  shell: sh -e {0}
  env:
    PNPM_HOME: /github/home/setup-pnpm/node_modules/.bin
    STORE_PATH: /__w/.pnpm-store/v3

Expected Result

The deployment-url output should contain the value from the Version Preview URL specified in the stdout of the versions upload command.

I suspect this is due to this code not checking for the versions command and therefore skipping the extraction of deployment-url.

@frontendphil
Copy link

I'm running into this exact problem as well, trying to configure some E2E tests that should run based on a preview deployment. I would also be grateful for any workaround suggestions.

@gentlementlegen
Copy link

gentlementlegen commented Jan 30, 2025

The deployment-url is also wrong on my side, but its value is set to https://github.com/cloudflare/workers-sdk/tree/main/packages/wrangler/telemetry.md. Downgrading wrangler version solved the issue at the moment.

Setting WRANGLER_SEND_METRICS=false which doesn't output that message about telemetry and the action gets the right URL as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants