Forgejo icon

Forgejo

Interact with Forgejo API

Overview

This node interacts with the Forgejo API to manage repository files, specifically supporting the deletion of files within a repository. It allows users to specify the repository owner, repository name, file path, commit message, and the SHA hash of the file to be deleted. The node sends a DELETE request to the Forgejo API to remove the specified file from the repository, committing the change with the provided message. This is useful for automating repository maintenance tasks, such as cleaning up obsolete files or managing repository content programmatically.

Use Case Examples

  1. Deleting a configuration file from a repository when it is no longer needed.
  2. Automating the removal of sensitive files from a repository as part of a security workflow.

Properties

Name Meaning
Owner The username or organization that owns the repository.
Repository The name of the repository where the file exists.
File Path The path to the file in the repository that should be deleted.
Commit Message The commit message describing the deletion action.
SHA The SHA hash of the file to be deleted, used to ensure the correct file version is targeted.

Output

JSON

  • json - The JSON response from the Forgejo API after deleting the file, indicating success or error details.

Dependencies

  • Requires an API key credential for Forgejo API authentication.

Troubleshooting

  • Ensure the SHA hash provided matches the current file version; otherwise, the deletion will fail due to version conflicts.
  • Verify that the repository owner and repository name are correct to avoid 'not found' errors.
  • Check that the commit message is provided as it is required for the deletion commit.
  • Handle API errors gracefully, especially permission issues or network errors, by enabling 'Continue On Fail' if needed.

Links

  • Forgejo API Documentation - Official API documentation for Forgejo, useful for understanding endpoints and request formats.

Discussion