Deployments: Write
Why Tier 2
Creates and deletes deployments for any branch, tag or commit, sets their statuses, and approves or rejects pending jobs where the caller is a required reviewer or the custom protection rule. A deployment triggers workflows on the deployment event at the commit it names, and a success status can satisfy a rule that requires deployments to succeed before merging. A deployment branch policy on the environment limits which refs can deploy.
Can reach T1 when an environment with production secrets has no deployment branch policy and a workflow on the deployment event deploys to it, or the caller is a required reviewer or the custom protection rule for it, so its approval releases them.
Inferred from: GitHub Docs: deployments, GitHub Docs: events that trigger workflows, GitHub Docs: deployments and environments
- Target
- Repository
- Plane
- DataWorkflows: Workflow files and runs, variables, deployments, environments and Pages.
- Granted by
- Fine-grained PAT, GitHub App, GITHUB_TOKEN
- Available on
- Every setup
- In a workflow
permissions: deployments: writeWorkflow scopes by tier
What it unlocks
5 REST endpoints need this permission, from GitHub's docs data. Some also need another permission, and a few work with only one kind of token.
- POST /repos/{owner}/{repo}/actions/runs/{run_id}/deployment_protection_ruleinstallation access tokens only
- POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments
- POST /repos/{owner}/{repo}/deployments
- DELETE /repos/{owner}/{repo}/deployments/{deployment_id}
- POST /repos/{owner}/{repo}/deployments/{deployment_id}/statuses
Roles that include it
No built-in role includes it. Only tokens, Apps or custom roles can grant it.
Classic scopes that reach it
- T0repodocumented
- T2public_repostated by GitHub
- T2repo_deploymentdocumented
Attack paths
Techniques it enables
- Trigger the publish workflow from a tampered branch Poison the build or published package
Escalations it starts
- Create a deployment that starts the deploy workflow: The deploy job's secrets and cloud access, running code nobody reviewed.
Fixed or limited by
- Branch protection on default/release branches: required reviews of the last push + required status checks
- Rulesets applied: push restriction, tag protection, sensitive file-path protection
- Set the default GITHUB_TOKEN permission to read-only at the org level
- Limit who and what can trigger workflows with workflow execution protections
- Put production secrets in environments with required reviewers