put_file
Create or update a file in a GitHub repository using the Contents API. Idempotent when the current blob SHA is provided for updates. Specify owner, repo, path, content, and commit message.
Instructions
Create or update a file via the Contents API. Idempotent when sha is correctly supplied for updates.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| owner | Yes | GitHub owner/org name. | |
| repo | Yes | Repository name. | |
| path | Yes | File path within the repo, no leading slash. | |
| content | Yes | UTF-8 file content. Will be base64-encoded for transport. | |
| message | Yes | Commit message. | |
| branch | No | Target branch. Default: the default branch. | |
| sha | No | Required when updating; the current blob SHA from get_file. Omit for create. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||