Forgejo icon

Forgejo

Interact with Forgejo API

Overview

This node operation updates the protection settings of a specific branch in a Forgejo repository. It allows users to configure branch protection features such as enabling push protection, enabling a push whitelist, and setting the number of required approvals before changes can be merged. This is useful for maintaining code quality and enforcing collaboration rules in software development projects.

Use Case Examples

  1. A development team wants to enforce that all changes to the main branch require at least two approvals before merging. They use this node to update the branch protection settings accordingly.
  2. An organization wants to prevent direct pushes to a critical branch to ensure all changes go through pull requests. They enable push protection and push whitelist using this node.

Properties

Name Meaning
Owner The username or organization that owns the repository where the branch exists.
Repository The name of the repository containing the branch to update protection for.
Branch Name The name of the branch whose protection settings are to be updated.
Protection Settings A collection of settings to configure branch protection, including enabling push protection, enabling push whitelist, and specifying the number of required approvals.

Output

JSON

  • json - The response from the Forgejo API after updating the branch protection settings, typically including the updated branch protection details or a success confirmation.

Dependencies

  • Requires an API key credential for Forgejo API authentication.

Troubleshooting

  • Ensure the provided owner, repository, and branch name are correct and exist in the Forgejo instance.
  • Verify that the API key credential has sufficient permissions to update branch protection settings.
  • Common errors include authentication failures, permission denied errors, or invalid branch names. Check the error message returned by the API for specific details and adjust inputs or credentials accordingly.

Links

  • Forgejo API Documentation - Official API documentation for Forgejo, useful for understanding branch protection endpoints and parameters.

Discussion