GitHub

GitHub operations — create issues and pull requests, comment on issues, list repositories, and read or write files via the GitHub REST API.

When to Use

Use GitHub when you need to automate repository workflows:

  • Create issues or pull requests from webhook or form data
  • Comment on existing issues or PRs with review feedback or bot replies
  • List repositories accessible to your token
  • Read or write files in a repository (e.g. config updates, generated docs)

Connect a GitHub node to an AI Agent Tools handle to let the agent interact with your repositories on demand.

Inputs

HandleTypeDescription
inputanyUpstream data for {{ input.field }} template references in settings.

Output

HandleTypeDescription
resultobjectGitHub operation result

The result (accessed as {{ github.* }}) shape:

FieldTypeDescription
successbooleanWhether the operation succeeded
urlstringURL to the created resource (issue, PR, or file) when applicable
dataobjectRaw GitHub API response payload
errorstringError message if success is false
{
  "success": true,
  "url": "https://github.com/owner/repo/issues/42",
  "data": { "number": 42, "title": "Bug report", "state": "open" },
  "error": null
}

Settings

Each node run executes a single operation. Set Operation, then configure the fields shown for that operation.

Operation

SettingTypeDefaultDescription
operationenumcreate_issueGitHub action to perform: create_issue, comment_on_issue, create_pr, list_repos, get_file, or create_or_update_file.

Agent Permissions

SettingTypeDefaultDescription
allowed_operationsmulti-selectAll operationsWhich operations are available when this plugin is used as an AI agent tool. Excluded from the tool schema — the agent can only invoke operations in this list.

Repository

Shown when operation is create_issue, comment_on_issue, create_pr, get_file, or create_or_update_file:

SettingTypeDefaultDescription
ownerstringRepository owner (user or organization). Supports {{ }} bindings.
repostringRepository name. Supports {{ }} bindings.

create_issue

Shown when operation is create_issue:

SettingTypeDefaultDescription
titlestringIssue title. Supports {{ }} bindings.
bodycode editorIssue body (Markdown). Supports {{ }} bindings.
labelsstringComma-separated label names. Supports {{ }} bindings.

comment_on_issue

Shown when operation is comment_on_issue:

SettingTypeDefaultDescription
issue_numbernumberIssue number to comment on. Supports {{ }} bindings.
bodycode editorComment body (Markdown). Supports {{ }} bindings.

create_pr

Shown when operation is create_pr:

SettingTypeDefaultDescription
titlestringPull request title. Supports {{ }} bindings.
bodycode editorPull request description. Supports {{ }} bindings.
head_branchstringSource branch containing your changes. Supports {{ }} bindings.
base_branchstringmainTarget branch. Supports {{ }} bindings.

list_repos

No additional settings beyond Operation and Agent Permissions. Lists repositories accessible to the authenticated token.

get_file

Shown when operation is get_file:

SettingTypeDefaultDescription
file_pathstringPath to the file in the repo (e.g. src/index.ts). Supports {{ }} bindings.

create_or_update_file

Shown when operation is create_or_update_file:

SettingTypeDefaultDescription
file_pathstringPath for the file in the repo. Supports {{ }} bindings.
file_contentcode editorFile content to write. Supports {{ }} bindings.
commit_messagestringCommit message for the change. Supports {{ }} bindings.

Required Secrets

Configure on the Environment Variables page:

VariableDescription
GITHUB_TOKENGitHub Personal Access Token (e.g. ghp_...). Create one at GitHub token settings. Typically requires repo scope for private repositories or public_repo for public repos only.

Example

Canvas

Create a GitHub issue from a webhook payload:

Webhook Trigger → GitHub (create_issue)

GitHub settings:

  • Operation: create_issue
  • Owner: my-org
  • Repository: my-repo
  • Title: {{ webhook.body.title }}
  • Body: Reported by {{ webhook.body.user }}\n\n{{ webhook.body.description }}
  • Labels: bug,automated

Access the result downstream:

{{ github.success }}
{{ github.url }}
{{ github.data.number }}

Read a config file and branch on errors:

Manual Trigger → GitHub (get_file) → If ({{ github.success }})
    → true:  Transform
    → false: (connect GitHub On Error output to a notification node)

Enable the On Error control output on the GitHub node to route API failures without stopping the entire workflow.

TSL

import webhook from @tensorify/webhook-trigger:4.0.0
import github from @tensorify/github:1.0.0

node trigger @tensorify/webhook-trigger:4.0.0 {
    path = "/bug-reports"
    method = "POST"
}

node create_issue @tensorify/github:1.0.0 {
    operation = "create_issue"
    owner = "my-org"
    repo = "my-repo"
    title = "{{ webhook.body.title }}"
    body = "{{ webhook.body.description }}"
    labels = "bug,automated"
}

trigger.payload -> create_issue.input

Error Handling

GitHub has a hidden On Error control output branch (error). Enable it via the "Error output handle" toggle at the bottom of the settings panel.

The error branch fires when the GitHub API returns an error or the request fails at runtime. On the main path, failures are also reflected in {{ github.success }} and {{ github.error }} on the result output — connect the error branch to handle failures without relying on downstream If nodes.

Common Gotchas

  • Token scopes: Private repo operations require a token with repo scope. list_repos returns only repositories the token can access.
  • File writes commit directly: create_or_update_file commits to the default branch — there is no branch selector. Use with care in production repos.
  • Check github.success: The node completes on the main output even when the API call fails. Use an If node or the On Error branch to handle failures.
  • Agent permissions: Restrict Allowed Operations (Agent) to prevent an AI agent from performing destructive actions like create_or_update_file.
  • Missing GITHUB_TOKEN: If the env var is not set, the node fails at runtime with an authentication error.

See Also

On this page