getRepoIssues Documentation
Overview
This node is designed to fetch issues from a specified GitHub repository using the GitHub API. It establishes a connection to the GitHub service, validates that required inputs are provided, and retrieves the issues associated with the specified repository. This logic serves as a backend utility function that supports a variety of applications requiring integration with GitHub data.
Purpose
The primary purpose of this function is to enable users to easily access issues in a given GitHub repository programmatically. This capability is essential for applications that need to analyze or manipulate GitHub issues, providing insights into project progress, issue tracking, and collaboration.
Settings
The following settings are defined for this node:
1. inputs
- Type: Object
- Description: This setting encompasses all the required input parameters for fetching repository issues. The structure must include the keys outlined below.
- Default Value: None (requires explicit specification)
a. owner
- Type: String
- Description: The GitHub username or organization name that owns the repository. This is a mandatory input and must be specified for the function to execute.
- Default Value: None
b. repo
- Type: String
- Description: The name of the repository from which issues are to be fetched. Like the
owner, this is also mandatory. - Default Value: None
c. page (optional)
- Type: Numeric
- Description: The page number of the results to retrieve, useful for pagination. If not specified, defaults to the first page (1).
- Default Value: 1
d. perPage (optional)
- Type: Numeric
- Description: The number of issues to return per page. This setting helps control the volume of data processed and displayed at once. If not specified, the GitHub API default may apply (usually 30 issues per page).
- Default Value: 30
e. state (optional)
- Type: String
- Description: The state of issues to filter by, which can be 'open', 'closed', or 'all'. Specifying this setting alters the result set to show only issues that match the chosen state.
- Default Value: 'open' (if unspecified)
2. config
- Type: Object
- Description: Additional configuration parameters needed for establishing the connection to GitHub. This is typically used for authentication purposes, but specific settings may vary based on the integration needs.
- Default Value: None
3. context
- Type: Object
- Description: The execution context, providing information needed about the runtime environment. This is commonly used by the integration connection to appropriately configure the connection to the GitHub service.
- Default Value: None
How It Works
The function starts by attempting to build a connection instance to GitHub using a secure connection, passing the 'github' integration type and the current execution context.
It then checks if the input parameters owner and repo are provided. If either is missing, an error is thrown.
If valid inputs are present, the function uses the established GitHub connection to request issues from the specified repository using the provided pagination and state parameters. The results from the API call are returned as an output object; specifically, the issues data is encapsulated in output1.
If an error occurs during any phase of the process, a structured error message is returned, indicating the nature of the issue encountered.
Data Expectations
This node expects inputs structured as follows:
- The
inputsobject involves mandatory keys (owner,repo) and optional ones (page,perPage,state). - The
configandcontextobjects must also be correctly formed but are typically managed internally or during execution.
Use Cases & Examples
Use Cases
-
Project Management Dashboard: A company uses a dashboard application that aggregates GitHub issues to visualize project progress and track outstanding tasks based on issue states (open/closed).
-
Automated Reporting Tool: An automation service generates weekly reports of issues in specific repositories to inform team members about outstanding work and priorities.
-
Bug Tracking System: A development team integrates GitHub issues into their internal bug tracking system, allowing them to monitor and manage bug reports directly from their workflow.
Example Configuration
Use Case: Project Management Dashboard
Configuration to Retrieve Open Issues from a Repository:
{
"inputs": {
"owner": "my-org",
"repo": "my-repo",
"page": 1,
"perPage": 10,
"state": "open"
},
"config": {},
"context": {}
}In this configuration:
owneris set tomy-org, specifying the organization name.repois set tomy-repo, indicating the targeted repository.pageis set to 1, to obtain the first page of results.perPageis set to 10, limiting results to 10 issues per API call.stateis set toopen, focusing on issues that are not resolved.
This setup would enable the dashboard to display up to 10 currently open issues from my-repo, facilitating project tracking for the team.