Forgejo icon

Forgejo

Interact with Forgejo API

Overview

This node interacts with the Forgejo API to manage branches within repositories. Specifically, the 'Delete' operation under the 'Branch' resource allows users to delete a specified branch from a repository. This is useful for repository maintenance, such as removing outdated or feature branches after merging. For example, a user can automate branch cleanup after pull requests are merged.

Use Case Examples

  1. Deleting a branch named 'feature-xyz' from the repository 'my-repo' owned by 'my-org'.
  2. Automating branch deletions as part of a CI/CD pipeline to keep the repository clean.

Properties

Name Meaning
Owner The username or organization that owns the repository.
Repository The name of the repository containing the branch.
Branch Name The name of the branch to delete.

Output

JSON

  • json - The JSON response from the Forgejo API after attempting to delete the branch. Typically contains success confirmation or error details.

Dependencies

  • Requires an API key credential for Forgejo API authentication.

Troubleshooting

  • Ensure the 'Owner', 'Repository', and 'Branch Name' fields are correctly specified; incorrect values will cause the API call to fail.
  • The branch to be deleted must exist; attempting to delete a non-existent branch will result in an error.
  • The API key credential must have sufficient permissions to delete branches in the specified repository.
  • Common error messages include authorization errors (due to invalid or insufficient credentials) and not found errors (if the branch or repository does not exist). Verify credentials and input parameters to resolve these.

Links

Discussion