create_or_update_file
Create or update a file in a GitHub repository by specifying the owner, repo, path, content, commit message, and branch. Includes optional SHA for updating existing files.
Instructions
Create or update a single file in a GitHub repository
Input Schema
Name | Required | Description | Default |
---|---|---|---|
branch | Yes | Branch to create/update the file in | |
content | Yes | Content of the file | |
message | Yes | Commit message | |
owner | Yes | Repository owner (username or organization) | |
path | Yes | Path where to create/update the file | |
repo | Yes | Repository name | |
sha | No | SHA of the file being replaced (required when updating existing files) |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"branch": {
"description": "Branch to create/update the file in",
"type": "string"
},
"content": {
"description": "Content of the file",
"type": "string"
},
"message": {
"description": "Commit message",
"type": "string"
},
"owner": {
"description": "Repository owner (username or organization)",
"type": "string"
},
"path": {
"description": "Path where to create/update the file",
"type": "string"
},
"repo": {
"description": "Repository name",
"type": "string"
},
"sha": {
"description": "SHA of the file being replaced (required when updating existing files)",
"type": "string"
}
},
"required": [
"owner",
"repo",
"path",
"content",
"message",
"branch"
],
"type": "object"
}