Update File
github.update_file
ActionBusiness appsconnection required
Calls PUT /repos/{owner}/{repo}/contents/{path} with the current blob SHA.
Commit new contents over an existing file, creating it when it is absent.
Connection
- Required
- Yes — the node will not save without one
- Auth type
- Bearer token
- Providers
- GitHub
- Secret shape
- the GitHub personal access token
- Resolved by
- config.connection_id, else node.connection_id, else the tenant's sole GitHub connection
Configuration
10 fields, 5 required. A dotted path is a nested object and name[] an array of objects — the editor renders the same tree.
| Field | Type | Required | Default | Constraints | Example |
|---|---|---|---|---|---|
owner Repository owner — the user or organisation login. Supports {{ }}. | string | Yes | — | — | octocat |
repo Repository name, without the owner prefix. Supports {{ }}. | string | Yes | — | — | hello-world |
path Path of the file inside the repository, e.g. docs/README.md. | string | Yes | — | — | docs/README.md |
content New file contents. | string | Yes | — | — | — |
content_encoding Set to base64 when content is already a base64 blob. | string | No | text | one of "text", "base64" | — |
message Commit message for this change. | string | Yes | — | — | Update docs/README.md |
branch Branch to commit on. Empty uses the repository's default branch. | string | No | — | — | — |
sha Blob SHA being replaced. Left empty the step reads it from the branch first. | string | No | — | — | — |
committer_name Commit author name. Defaults to the token's user. | string | No | — | — | — |
committer_email Commit author email. Required when committer_name is set. | string | Conditional | — | email format; only with committer_name | — |
Example configuration
Every value below is the contract’s own example or default — nothing invented.
{
"content_encoding": "text",
"message": "Update docs/README.md",
"owner": "octocat",
"path": "docs/README.md",
"repo": "hello-world"
}Output
One shape.
result
| Field | Type | Example |
|---|---|---|
ok True when GitHub accepted the call. | boolean | true |
path Path of the file that was written. | string | — |
sha Blob SHA of the new content — pass it to the next update. | string | — |
size Size of the new blob in bytes. | number | — |
html_url Link to the file on GitHub. | string | — |
commit_sha SHA of the commit this write created. | string | — |
commit_html_url Link to that commit. | string | — |
{
"commit_html_url": "",
"commit_sha": "",
"html_url": "",
"ok": true,
"path": "",
"sha": "",
"size": 0
}Notes
- The contents API needs the current blob SHA; without one the call is a create and GitHub rejects it for a path that exists.
Solutions with GitHub
See Update File run in a workflow.
In a technical demo we add the GitHub connection, drop the node on the canvas and let Workflow Health pre-flight it before the first real run.