Github
Comprehensive guide to the Github node in StackAI workflows, including key actions, input requirements, configurations, and output examples.
What is the Github Node?
The Github node in StackAI enables seamless integration with Github, allowing you to automate, query, and manage repositories, workflows, and project data directly within your workflow. This node connects your StackAI automation to Github’s powerful API, making it easy to interact with repositories, pull requests, workflows, and more.
How to Use It?
To use the Github node, add it to your StackAI workflow and select the desired action. Connect your Github account using a valid connection ID if required. Configure the action by providing the necessary input parameters and configurations. The node will execute the selected action and return the output, which can be used in downstream nodes.
Example of Usage
Suppose you want to list all branches in a repository. You would select the "List Branches" action, provide the repository owner and name as required inputs, and the node will return a list of branches.
Commonly Used Actions in the Github Node
Below are some of the most commonly used Github actions available in StackAI workflows. For each action, you’ll find a description, required inputs, configurations, and example outputs.
1. List Branches
Description: Retrieve a list of branches for a specified Github repository.
Inputs:
owner
(Required): The username or organization name that owns the repository. Example:"octocat"
repo
(Required): The name of the repository. Example:"Hello-World"
Configurations:
connection_id
(Required): The Github connection ID for authentication.
Outputs:
branches
(Required): An array of branch objects, each containing branch name and commit details.
Example: Input:
{
"owner": "octocat",
"repo": "Hello-World"
}
Output:
{
"branches": [
{ "name": "main", "commit": { "sha": "abc123", ... } },
{ "name": "dev", "commit": { "sha": "def456", ... } }
]
}
2. List Commits
Description: Fetch a list of commits from a repository.
Inputs:
owner
(Required): Repository owner.repo
(Required): Repository name.sha
(Optional): SHA or branch to start listing commits from.
Configurations:
connection_id
(Required): Github connection ID.
Outputs:
commits
(Required): Array of commit objects with details like SHA, author, and message.
Example: Input:
{
"owner": "octocat",
"repo": "Hello-World"
}
Output:
{
"commits": [
{ "sha": "abc123", "commit": { "message": "Initial commit", ... } },
{ "sha": "def456", "commit": { "message": "Update README", ... } }
]
}
3. List Pull Requests
Description: Retrieve all pull requests for a repository.
Inputs:
owner
(Required): Repository owner.repo
(Required): Repository name.state
(Optional): Filter by state (open
,closed
,all
).
Configurations:
connection_id
(Required): Github connection ID.
Outputs:
pull_requests
(Required): Array of pull request objects with title, state, and author.
Example: Input:
{
"owner": "octocat",
"repo": "Hello-World",
"state": "open"
}
Output:
{
"pull_requests": [
{ "number": 1, "title": "Add new feature", "state": "open", ... }
]
}
4. Get Repository Details
Description: Fetch metadata and details about a specific repository.
Inputs:
owner
(Required): Repository owner.repo
(Required): Repository name.
Configurations:
connection_id
(Required): Github connection ID.
Outputs:
repository
(Required): Object containing repository details such as description, stars, forks, and more.
Example: Input:
{
"owner": "octocat",
"repo": "Hello-World"
}
Output:
{
"repository": {
"name": "Hello-World",
"description": "This is your first repository",
"stargazers_count": 42,
"forks_count": 10,
...
}
}
5. List Releases
Description: Get a list of releases published in a repository.
Inputs:
owner
(Required): Repository owner.repo
(Required): Repository name.
Configurations:
connection_id
(Required): Github connection ID.
Outputs:
releases
(Required): Array of release objects with tag name, release notes, and published date.
Example: Input:
{
"owner": "octocat",
"repo": "Hello-World"
}
Output:
{
"releases": [
{ "tag_name": "v1.0.0", "name": "First Release", ... }
]
}
Best Practices:
Always provide the required
owner
,repo
, andconnection_id
for all actions.Use the output of the Github node as input for downstream nodes, such as LLMs or output nodes, to automate reporting or notifications.
For advanced use cases, chain multiple Github actions to build complex automations.
Summary
The Github node in StackAI empowers you to automate and manage Github repositories, branches, commits, pull requests, and more. By configuring the right action and providing the necessary inputs, you can streamline your development workflows and integrate Github data into your automation pipelines.
Last updated
Was this helpful?