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
- Confirm the producing step has an id and writes the output to GITHUB_OUTPUT.
- Reference that exact step id and output name in environment.url.
- 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@v4How 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
GitHub Actions "Missing environment 'production'"Fix the GitHub Actions missing-environment error - a job references an environment that does not exist in the…
GitHub Actions "actions/deploy-pages: Failed to create deployment"Fix the actions/deploy-pages error "Failed to create deployment" - a permissions gap or a transient Pages API…
GitHub Actions "Failed to create deployment" status errorFix the GitHub Actions "Failed to create deployment" error - the deployments API call failed due to permissio…