GitHub Actions Environment URL Not Showing / "Invalid environment URL"
A deployment's environment URL does not appear on the run/PR, or the workflow errors on the URL, because the environment_url output is missing, not a valid http(s) URL, or the job has no environment: block to attach it to.
What this error means
The expected "View deployment" link with the environment URL is missing from the run or PR, or a step sets environment_url to something that is rejected as not a valid URL.
# environment_url must be a full http(s) URL on a job WITH an environment
- run: echo "environment_url=myapp.example.com" >> "$GITHUB_OUTPUT"
# missing scheme; and no environment: block means nothing to attach it toCommon causes
URL missing scheme or invalid
The environment URL must be a full http:// or https:// URL. A bare host or a relative path is not a valid environment URL and is dropped or rejected.
No environment: block on the job
The environment URL attaches to a deployment environment. A job without an environment: declaration has no environment to set a URL on, so it never shows.
How to fix it
Declare the environment with a valid URL
Add an environment: block with a name and a full https URL, or set it dynamically from a step output.
jobs:
deploy:
runs-on: ubuntu-latest
environment:
name: production
url: https://app.example.com # full, valid http(s) URL
steps:
- run: ./deploy.shSet the URL dynamically and correctly
- When computing the URL, ensure it includes https:// before assigning it.
- Reference it as environment.url: ${{ steps.deploy.outputs.url }} from a step that emits a full URL.
- Confirm the job has an environment: block so the URL has somewhere to attach.
How to prevent it
- Always provide a full http(s) URL for environment URLs.
- Declare an environment: block on deployment jobs.
- Validate any dynamically built URL includes a scheme.