github_repos_create_or_update_file
Create a new file or replace an existing GitHub repository file in one commit. For updates, pass the existing file SHA; omit it when creating.
Instructions
Create a file or replace an existing one, in a single commit. Write the content as plain text. To replace a file, read it first and pass its sha; without one GitHub treats this as a create and refuses if the path exists.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sha | No | The blob SHA of the file being replaced. Required when updating an existing file, omitted when creating a new one. | |
| path | Yes | Path to the file, relative to the repository root. | |
| repo | Yes | The name of the repository without the `.git` extension. The name is not case sensitive. | |
| owner | Yes | The account owner of the repository. The name is not case sensitive. | |
| author | No | Who wrote the change, if not the committer. | |
| branch | No | The branch to commit to. Absent, the default branch. | |
| content | Yes | Plain text content | |
| message | Yes | The commit message. | |
| committer | No | Who made the commit. Absent, the authenticated user. |