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).
Error: Failed to create deployment (status: 403)
Resource not accessible by integrationCommon 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
- Add permissions with deployments: write to the job.
- Keep contents: read so the rest of the job functions.
- Re-run after the permission change.
jobs:
deploy:
permissions:
deployments: write
contents: read
runs-on: ubuntu-latestRetry transient API failures
- For intermittent 5xx responses, re-run the failed job.
- 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.