Skip to content
Latchkey

GitHub Actions "Failed to create deployment" status error

Creating a deployment via the API requires deployments: write on GITHUB_TOKEN. Permission gaps fail deterministically; an occasional 5xx from the deployments API is transient and safe to retry.

What this error means

A deploy job fails when an action calls the deployments API to record a deployment, returning a 403 (permission) or an intermittent 5xx (transient).

github-actions
Error: Failed to create deployment (status: 403)
Resource not accessible by integration

Common causes

Missing deployments: write permission

The default read-only token cannot create deployment objects, producing a 403 resource-not-accessible error.

Transient deployments API 5xx

An intermittent server error from the deployments API can fail the call even when permissions are correct.

How to fix it

Grant deployments: write

  1. Add permissions with deployments: write to the job.
  2. Keep contents: read so the rest of the job functions.
  3. Re-run after the permission change.
.github/workflows/deploy.yml
jobs:
  deploy:
    permissions:
      deployments: write
      contents: read
    runs-on: ubuntu-latest

Retry transient API failures

  1. For intermittent 5xx responses, re-run the failed job.
  2. Wrap custom API calls in a short retry with backoff if you script the deployment yourself.

How to prevent it

  • Set deployments: write explicitly on jobs that record deployments.
  • On Latchkey managed runners, transient deployments-API 5xx failures are retried automatically so flaky status calls do not fail the run.

Frequently asked questions

What causes ""Failed to create deployment""?
The default read-only token cannot create deployment objects, producing a 403 resource-not-accessible error.
How do I fix "Failed to create deployment"?
Grant deployments: write

Related guides

References

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