Skip to content
Latchkey

GitHub Actions deployment "environment URL not set"

The environment.url shows on the deployment card only if the expression you assign resolves to a non-empty string. A missing or mis-referenced step output leaves it blank or fails validation.

What this error means

The deployment succeeds but the environment URL is empty on the run, or validation complains the url expression resolved to nothing.

github-actions
Warning: environment.url evaluated to an empty value
${{ steps.deploy.outputs.page_url }}  ->  ''

Common causes

Referenced step output never set

The url points at steps.<id>.outputs.<name> but that step did not write the output (wrong id or output name).

Output set after the environment resolves

The value is produced in a later step than the one the url expression reads.

How to fix it

Wire the URL to a real step output

  1. Confirm the producing step has an id and writes the output to GITHUB_OUTPUT.
  2. Reference that exact step id and output name in environment.url.
  3. For Pages, use the deploy-pages step output page_url.
.github/workflows/deploy.yml
    environment:
      name: production
      url: ${{ steps.deploy.outputs.page_url }}
    steps:
      - id: deploy
        uses: actions/deploy-pages@v4

How to prevent it

  • Always set the deployment output before the environment URL is read.
  • Double-check the step id and output name match exactly.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →