ghtier
← All permissions
Repository permission·contents:write

Contents: Write

Tier 2 · Medium

Why Tier 2

Pushes commits, creates, moves and deletes branches, tags and releases, merges pull requests, and sends repository_dispatch events. Cannot change files under .github/workflows without Workflows: write. On a repository other projects consume, moving a tag changes what they run, unless the tag belongs to an immutable release: its tag and assets are locked, though the release can still be deleted.

Can reach T1 when a workflow that uses secrets runs code it can change, such as build scripts, tests, package manifests or a local action outside .github/workflows, on a push to a branch it creates, or passes a repository_dispatch payload it sends to a shell.

Inferred from: GitHub Docs: secure use, GitHub Docs: events that trigger workflows, GitHub Docs: reposTested 2026-10-31 in a test organization: A GitHub App with only Contents (write) pushed a new branch that changed a local action under .github/actions. The push workflow ran as the App and the changed action printed the length of a repository secret. The same App's push of a change under .github/workflows was refused for lack of Workflows (write).

Target
Repository
Plane
DataCode: Repository contents, branches, tags, pull requests, checks and commit signing keys.
Granted by
Fine-grained PAT, GitHub App, GITHUB_TOKEN
Available on
Every setup
In a workflow
permissions: contents: writeWorkflow scopes by tier

What it unlocks

46 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}/branches/{branch}/rename
  • POST /repos/{owner}/{repo}/code-scanning/alerts/{alert_number}/autofix/commits
  • DELETE /repos/{owner}/{repo}/code-scanning/codeql/databases/{language}
  • POST /repos/{owner}/{repo}/code-scanning/codeql/variant-analyses
  • PATCH /repos/{owner}/{repo}/comments/{comment_id}
  • DELETE /repos/{owner}/{repo}/comments/{comment_id}
  • POST /repos/{owner}/{repo}/comments/{comment_id}/reactions
  • DELETE /repos/{owner}/{repo}/comments/{comment_id}/reactions/{reaction_id}
  • PUT /repos/{owner}/{repo}/contents/{path}also needs Workflows: Write
  • PUT /repos/{owner}/{repo}/contents/{path}also needs Workflows: Write

Roles that include it

Custom role permissions that add it

An owner can build a custom role from these on Enterprise Cloud. Nobody holds one until a custom role with it is assigned.

  • Push commits to protected branchespush_protected_branchrepository role
  • Create protected tagscreate_tagrepository role
  • Delete protected tagsdelete_tagrepository role
  • Bypass branch protectionsbypass_branch_protectionrepository role

Classic scopes that reach it

Attack paths

Techniques it enables

Escalations it starts

Reached through

Fixed or limited by

Other levels

GitHub Docs: Repository permissions for "Contents"