Forgejo icon

Forgejo

Interact with Forgejo API

Overview

This node interacts with the Forgejo API to update a file in a specified repository. It allows users to modify the content of an existing file by providing the repository owner, repository name, file path, new content, commit message, and the SHA hash of the file to be updated. This operation is useful for automating updates to files in version-controlled repositories, such as updating documentation, configuration files, or source code programmatically.

Use Case Examples

  1. Automatically update a README file in a repository with new information.
  2. Modify configuration files in a repository as part of a CI/CD pipeline.
  3. Update source code files in a repository based on external inputs or triggers.

Properties

Name Meaning
Owner The username or organization that owns the repository.
Repository The name of the repository where the file is located.
File Path The path to the file within the repository that needs to be updated.
Content The new content for the file, which will be base64 encoded automatically before sending to the API.
Commit Message The commit message describing the update to the file.
SHA The SHA hash of the file to be updated, used to ensure the correct version of the file is modified.

Output

JSON

  • json
    • content - Details of the updated file content returned from the API
    • commit - Information about the commit created for the file update

Dependencies

  • Forgejo API authentication credentials

Troubleshooting

  • Ensure the SHA provided matches the current file version to avoid conflicts or errors.
  • Verify that the repository owner and repository name are correct and accessible with the provided credentials.
  • Check that the file path is correct and the file exists in the repository.
  • Make sure the commit message is provided as it is required for the update operation.

Discussion