GitHub Actions Deployment Environment URL Not Shown on the Run
A deployment job runs but the environment shows no clickable URL. The job must set environment with both a name and a url, and the workflow needs deployments: write to record the deployment.
What this error means
The Deployments view or the run’s environment badge shows the environment but no "View deployment" link, so reviewers cannot jump to the deployed site.
jobs:
deploy:
environment: production # name only - no URL recorded
runs-on: ubuntu-latest
steps: [{ run: ./deploy.sh }]Common causes
environment set as a name without url
Using the short string form (environment: production) names the environment but records no URL. The url key is required to surface a link.
Missing deployments: write permission
Recording a deployment (and its URL) needs deployments: write. A read-only token may run the job without registering a linked deployment.
How to fix it
Set name and url on the environment
Use the object form with name and url, and grant deployments: write.
permissions:
deployments: write
jobs:
deploy:
environment:
name: production
url: ${{ steps.deploy.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- id: deploy
run: echo "page_url=https://app.example.com" >> "$GITHUB_OUTPUT"Produce a valid absolute URL
- Make the url an absolute https URL - relative paths do not render a link.
- Compute the URL in a step and pass it via GITHUB_OUTPUT.
- Ensure deployments: write is granted so the deployment is recorded.
How to prevent it
- Use the environment object form with name and url for deploy jobs.
- Grant deployments: write so the linked deployment is recorded.
- Emit an absolute https URL from a step output.