Reference
willo_edit_file
Change part of a site file on GitHub by exact text replacement — the default way to change an existing file.
- Act
- May need approval
- Secret scan
- Metered
On this page
Edit a site file. old_text + new_text for one replacement, or edits: [{old_text, new_text}, …] (up to 25, all-or-nothing, each old_text unique in the file) for several in one commit. Copy old_text exactly from willo_read_file. Lands on draft while drafting, else on main and LIVE at once. Pass sha to insist on the version you read. Runs without a card, except package.json and lockfiles (a person approves the dependency change). Same refusals as willo_write_file. Undoable from the dashboard.
Access
- Token: read + act, and editor access or higher on the business.
- Approval: Only when Willo's chat would stop for the same action. The description says when; otherwise the call runs at once.
- Secret scan: refused if the new content holds a value shaped like an API key or token.
- Metered: counts toward a per-business, per-minute limit for this kind of call. See Limits.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
path | string | yes | Repo-relative path of an existing file. |
old_text | string | no | Single form: the exact text to replace. Omit when using edits. |
new_text | string | no | Single form: the replacement. Omit when using edits. |
edits | object[] | no | Batch form: several replacements in this one file, applied together or not at all. |
sha | string | no | Optional: the sha from willo_read_file; the edit is refused if the file has changed since. |
summary | string | no | One plain sentence for the owner on what this does for them. |