Codeberg icon

Codeberg

Interact with the Codeberg API

File → Delete

AI-generated

Summary

Delete a file from a specified repository on Codeberg by providing the repository owner, repository name, file path, current file SHA, and a commit message. Optionally, delete can be performed on a specific branch or by creating a new branch for the commit.

Inputs

  • Authentication — Choose authentication method: Access Token or OAuth2.
  • Repository Owner (required) — Owner of the repository.
  • Repository Name (required) — Name of the repository.
  • File Path (required) — Path of the file to delete.
  • SHA (required) — The current SHA of the file (required to prevent conflicts).
  • Commit Message (required) — The commit message for deleting the file.
  • Additional Fields — Optional fields such as: branch to commit to or new branch creation details.

Output shape

a single JSON object representing the API response to the delete action, typically confirming deletion or providing related metadata

The operation returns the API delete response as JSON. Use the specified SHA to avoid conflicts. If branch or newBranch are specified in Additional Fields, commits are applied accordingly.

Examples

Example 1: Delete 'docs/README.md' file from 'my-org/my-repo' repository on default branch

Set 'Repository Owner' to 'my-org', 'Repository Name' to 'my-repo', 'File Path' to 'docs/README.md', provide the current SHA of the file, and a commit message like 'Remove README'. Leave Additional Fields empty or specify a branch if needed.

Links

Discussion