Codeberg icon

Codeberg

Interact with the Codeberg API

File → Update

AI-generated

Summary

Update a file's content in a specified repository on Codeberg by providing the current file SHA to avoid conflicts and a commit message describing the change.

Inputs

  • Authentication — Method of authentication, either Access Token or OAuth2.
  • Repository Owner (required) — Owner of the repository where the file resides.
  • Repository Name (required) — Name of the repository.
  • File Path (required) — Path of the file to update (e.g., docs/README.md).
  • Content (required) — New plain text content for the file; it will be automatically base64-encoded.
  • SHA (required) — Current SHA of the file to prevent update conflicts.
  • Commit Message (required) — Commit message describing the update.
  • Branch — Branch to commit the changes to. Optional.
  • New Branch — Create a new branch from a specified branch and commit to it. Optional.

Output shape

a single record

Returns the API response of the updated file's metadata and details as JSON. The response structure follows Codeberg's API file update format.

Links

Discussion