Forgejo icon

Forgejo

Interact with Forgejo API

Overview

This node operation creates a new branch in a specified repository on Forgejo. It requires the repository owner, repository name, the new branch name, and the source branch from which the new branch will be created. This is useful for automating branch management in development workflows, such as creating feature branches or hotfix branches programmatically.

Use Case Examples

  1. Creating a new feature branch 'feature-x' from 'main' branch in a repository owned by 'user123' named 'my-repo'.
  2. Automating branch creation in CI/CD pipelines to prepare isolated environments for testing.

Properties

Name Meaning
Owner The username or organization that owns the repository where the branch will be created.
Repository The name of the repository where the branch will be created.
Branch Name The name of the new branch to create.
Source Branch The existing branch from which the new branch will be created.

Output

JSON

  • json
    • new_branch_name - The name of the newly created branch.
    • old_branch_name - The source branch from which the new branch was created.
    • * - Additional details about the created branch returned by the Forgejo API.

Dependencies

  • Forgejo API authentication credentials (API key or token)

Troubleshooting

  • Ensure that the provided owner and repository names are correct and that the authenticated user has permission to create branches in the repository.
  • Verify that the source branch exists in the repository before attempting to create a new branch from it.
  • Common errors include 404 Not Found if the repository or source branch does not exist, and 403 Forbidden if the user lacks permissions. Check API credentials and repository access rights.

Links

Discussion