Skip to content
Latchkey

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.

.github/workflows/ci.yml
# 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 to

Common 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.

.github/workflows/ci.yml
jobs:
  deploy:
    runs-on: ubuntu-latest
    environment:
      name: production
      url: https://app.example.com   # full, valid http(s) URL
    steps:
      - run: ./deploy.sh

Set the URL dynamically and correctly

  1. When computing the URL, ensure it includes https:// before assigning it.
  2. Reference it as environment.url: ${{ steps.deploy.outputs.url }} from a step that emits a full URL.
  3. 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.

Frequently asked questions

What causes "environment URL 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.
How do I fix environment URL invalid?
Add an environment: block with a name and a full https URL, or set it dynamically from a step output.

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card