Forgejo icon

Forgejo

Interact with Forgejo API

Overview

This node interacts with the Forgejo API to create a new file in a specified repository. It is useful for automating file creation tasks in repositories, such as adding configuration files, documentation, or code snippets programmatically. For example, it can be used in CI/CD pipelines to add or update files in a repository based on certain triggers.

Use Case Examples

  1. Automatically create a README file in a new repository.
  2. Add a configuration file to a repository when a new project is initialized.

Properties

Name Meaning
Owner The username or organization that owns the repository where the file will be created.
Repository The name of the repository where the file will be created.
File Path The path within the repository where the new file will be created.
Content The content of the file to be created. This content will be base64 encoded automatically.
Commit Message The commit message to associate with the file creation.

Output

JSON

  • json
    • content - Details of the created file including its path, SHA, and URL.
    • commit - Information about the commit created for the file addition.

Dependencies

  • Forgejo API

Troubleshooting

  • Ensure the provided owner and repository names are correct and accessible with the provided API credentials.
  • Verify that the file path does not already exist in the repository to avoid conflicts.
  • Check that the commit message is not empty as it is required for the operation.
  • Handle API rate limits or authentication errors by verifying the API key or token used for authentication.

Links

  • Forgejo API Documentation - Official API documentation for Forgejo, useful for understanding the endpoints and parameters used.

Discussion