Gitea icon

Gitea

Interact with Gitea via API

Actions393

Overview

This node operation retrieves the list of commits associated with a specific pull request in a repository hosted on a Gitea instance. It is useful for workflows that need to analyze, audit, or process the commits made in a pull request, such as generating changelogs, triggering CI/CD pipelines based on commit content, or reviewing code changes programmatically.

Practical examples include:

  • Automatically fetching all commits from a pull request to run custom validation or testing.
  • Extracting commit metadata for reporting or integration with other tools.
  • Monitoring pull request activity by tracking commits added over time.

Properties

Name Meaning
Owner The owner (user or organization) of the repository where the pull request exists.
Repo The name of the repository containing the pull request.
Index The index (number) identifying the specific pull request to retrieve commits from.
Page The page number of results to return (1-based pagination).
Limit The maximum number of commits to return per page (page size).
Verification Whether to include verification details for each commit (true/false). Disabling speeds up response.
Files Whether to include the list of files affected by each commit (true/false). Disabling speeds up response.

Output

The output JSON contains an array of commit objects corresponding to the commits in the specified pull request. Each commit object includes standard commit information such as commit ID, message, author, date, and optionally:

  • Verification details if enabled.
  • List of files changed in the commit if enabled.

If binary data were involved (e.g., file contents), it would be included accordingly, but this operation focuses on commit metadata only.

Dependencies

  • Requires access to a Gitea instance API endpoint.
  • Needs an API authentication token credential configured in n8n to authorize requests.
  • The base URL for the Gitea API must be set in the credentials configuration.

Troubleshooting

  • Common issues:

    • Incorrect repository owner or name will result in "not found" errors.
    • Invalid pull request index may cause empty results or errors.
    • Pagination parameters (page, limit) set incorrectly might lead to no data or partial data.
    • Disabling verification or files can speed up responses but omit detailed commit info.
  • Error messages:

    • Authentication failures indicate missing or invalid API credentials.
    • HTTP 404 errors suggest the repository or pull request does not exist.
    • Rate limiting errors require waiting or adjusting API usage.

Resolving these typically involves verifying input parameters, ensuring correct API credentials, and checking the existence of the target repository and pull request.

Links and References

Discussion