Developer

GitHub

Read CI job logs, rerun failed jobs and dispatch existing GitHub Actions workflows from OrgSDK using your project’s GitHub credential.

View 37 plugin functions ↓

Use GitHub in a project

  • Read incoming issues and apply labels from a reviewed action
  • Review pull request metadata and comments, then request reviewers
  • Inspect job logs for a failed CI run and rerun its failed jobs
  • Draft releases with a generated changelog from merged PRs
  • Dispatch an existing deployment workflow at a branch or release tag

Access and credentials

Read and write GitHub issues, pull requests, branches, files, Actions, and releases. Reads are non-mutating; writes and merges are mutating.

This plugin uses an API token. Store credentials in OrgSDK and select them for the project that needs access.

Find recent CI runs on main

In Studio, open your project’s Plugins page and enable GitHub. Connect the account you want to use. Paste this example into an action in the same project.

// Replace the owner and repo with yours to see the last five runs.
return await github.listWorkflowRuns({
  "owner": "your-org",
  "repo": "your-repo",
  "branch": "main",
  "maxResults": 5
});

Each run includes an ID, head SHA, status, conclusion and GitHub URL. Pass its ID to getWorkflowRun or listWorkflowJobs to inspect that particular build.

Workflow examples and guides

Use with OrgSDK

OrgSDK gives external AI clients persistent projects and controlled execution. Plugins add optional tools to those projects. Each run uses pinned plugin versions, and project configuration determines which credentials they can use.

Set up OrgSDK locally ↗

Capabilities

37 functions from this published version. Read calls retrieve or process information; write actions can change data in the connected service.

37 of 37 functions

List workflow runs for a repository. Optionally filter by actionId (filename or ID), branch, status ('queued', 'in_progress', 'completed').

Parameters and return value
ParameterTypeDetails
ownerstring—
repostring—
actionIdOptionalstring | number—
branchOptionalstring—
statusOptionalstring—
maxResultsOptionalnumber—

Returns Promise<Array<{ id: number; name: string | null; status: string | null; conclusion: string | null; headBranch: string | null; headSha: string; event: string; htmlUrl: string; runNumber: number; createdAt: string; updatedAt: string }>>

Get details of a specific workflow run by ID.

Parameters and return value
ParameterTypeDetails
ownerstring—
repostring—
runIdnumber—

Returns Promise<{ id: number; name: string | null; status: string | null; conclusion: string | null; headBranch: string | null; headSha: string; event: string; htmlUrl: string; runNumber: number; createdAt: string; updatedAt: string }>

Trigger a workflow_dispatch event. actionId can be the workflow filename (e.g. 'ci.yml') or numeric ID. ref is the branch/tag to run on.

Parameters and return value
ParameterTypeDetails
ownerstring—
repostring—
actionIdstring | number—
refstring—
inputsOptionalRecord<string, string>—

Returns Promise<{ triggered: true }>

Re-run only the failed jobs of a workflow run. Returns immediately — poll getWorkflowRun to track progress.

Parameters and return value
ParameterTypeDetails
ownerstring—
repostring—
runIdnumber—

Returns Promise<{ rerunned: true }>

Re-run all jobs in a workflow run. Returns immediately — poll getWorkflowRun to track progress.

Parameters and return value
ParameterTypeDetails
ownerstring—
repostring—
runIdnumber—

Returns Promise<{ rerunned: true }>

Cancel an in-progress workflow run.

Parameters and return value
ParameterTypeDetails
ownerstring—
repostring—
runIdnumber—

Returns Promise<{ cancelled: true }>

List jobs for a workflow run. Includes step-level detail so you can see which step failed. filter can be 'latest' (default) or 'all' (includes previous attempts).

Parameters and return value
ParameterTypeDetails
ownerstring—
repostring—
runIdnumber—
filterOptionalstring—
maxResultsOptionalnumber—

Returns Promise<Array<{ id: number; runId: number; name: string; status: string; conclusion: string | null; startedAt: string | null; completedAt: string | null; htmlUrl: string; runnerName: string | null; steps: Array<{ name: string; status: string; conclusion: string | null; number: number }> }>>

Download logs for a specific job. Output is capped at 100KB. Use listWorkflowJobs first to get the jobId.

Parameters and return value
ParameterTypeDetails
ownerstring—
repostring—
jobIdnumber—

Returns Promise<{ logs: string; truncated: boolean }>

List artifacts produced by a workflow run.

Parameters and return value
ParameterTypeDetails
ownerstring—
repostring—
runIdnumber—
maxResultsOptionalnumber—

Returns Promise<Array<{ id: number; name: string; sizeInBytes: number; expired: boolean; expiresAt: string | null; createdAt: string | null; updatedAt: string | null }>>

Get a temporary download URL for a workflow artifact (zip). The URL is short-lived. Use listWorkflowRunArtifacts first to get the artifactId.

Parameters and return value
ParameterTypeDetails
ownerstring—
repostring—
artifactIdnumber—

Returns Promise<{ downloadUrl: string }>

List branches for a GitHub repository.

Parameters and return value
ParameterTypeDetails
ownerstring—
repostring—
maxResultsOptionalnumber—

Returns Promise<Array<{ name: string; sha: string; protected: boolean }>>

Get details of a specific branch including latest commit info.

Parameters and return value
ParameterTypeDetails
ownerstring—
repostring—
branchstring—

Returns Promise<{ name: string; sha: string; protected: boolean; commitMessage: string; commitAuthor: string | null }>

Create a new branch. fromRef defaults to the repo's default branch. Example: createBranch('owner', 'repo', 'feature/new', 'main').

Parameters and return value
ParameterTypeDetails
ownerstring—
repostring—
branchNamestring—
fromRefOptionalstring—

Returns Promise<{ ref: string; sha: string }>

Get the content of a file from a GitHub repository. Auto-decodes base64 to UTF-8. Errors on files >1MB. Use ref to specify a branch/tag/commit.

Parameters and return value
ParameterTypeDetails
ownerstring—
repostring—
pathstring—
refOptionalstring—

Returns Promise<{ name: string; path: string; sha: string; size: number; content: string; htmlUrl: string }>

Create or update a file in a GitHub repository. Provide sha to update an existing file (get it from getFileContent). Content is auto-encoded to base64.

Parameters and return value
ParameterTypeDetails
ownerstring—
repostring—
pathstring—
contentstring—
messagestring—
branchOptionalstring—
shaOptionalstring—

Returns Promise<{ path: string; sha: string; htmlUrl: string }>

List contents of a directory in a GitHub repository. Defaults to root. Use ref to specify a branch/tag/commit.

Parameters and return value
ParameterTypeDetails
ownerstring—
repostring—
pathOptionalstring—
refOptionalstring—

Returns Promise<Array<{ name: string; path: string; type: 'file' | 'dir' | 'submodule' | 'symlink'; sha: string; size: number; htmlUrl: string }>>

List issues for a GitHub repository. Filters out pull requests. State: 'open', 'closed', 'all'. Labels: comma-separated string.

Parameters and return value
ParameterTypeDetails
ownerstring—
repostring—
stateOptionalstring—
labelsOptionalstring—
assigneeOptionalstring—
maxResultsOptionalnumber—

Returns Promise<Array<{ id: number; number: number; title: string; body: string | null; state: string; labels: string[]; assignees: string[]; user: string | null; htmlUrl: string; commentsCount: number; createdAt: string; updatedAt: string; closedAt: string | null }>>

Get a single GitHub issue by number.

Parameters and return value
ParameterTypeDetails
ownerstring—
repostring—
issueNumbernumber—

Returns Promise<{ id: number; number: number; title: string; body: string | null; state: string; labels: string[]; assignees: string[]; user: string | null; htmlUrl: string; commentsCount: number; createdAt: string; updatedAt: string; closedAt: string | null }>

Create a new GitHub issue.

Parameters and return value
ParameterTypeDetails
ownerstring—
repostring—
titlestring—
bodyOptionalstring—
labelsOptionalstring[]—
assigneesOptionalstring[]—

Returns Promise<{ id: number; number: number; title: string; body: string | null; state: string; labels: string[]; assignees: string[]; user: string | null; htmlUrl: string; commentsCount: number; createdAt: string; updatedAt: string; closedAt: string | null }>

Update a GitHub issue. Only provided fields are changed. State: 'open' or 'closed'.

Parameters and return value
ParameterTypeDetails
ownerstring—
repostring—
issueNumbernumber—
titleOptionalstring—
bodyOptionalstring—
stateOptionalstring—
labelsOptionalstring[]—
assigneesOptionalstring[]—

Returns Promise<{ id: number; number: number; title: string; body: string | null; state: string; labels: string[]; assignees: string[]; user: string | null; htmlUrl: string; commentsCount: number; createdAt: string; updatedAt: string; closedAt: string | null }>

Add a comment to a GitHub issue.

Parameters and return value
ParameterTypeDetails
ownerstring—
repostring—
issueNumbernumber—
bodystring—

Returns Promise<{ id: number; body: string; user: string | null; htmlUrl: string; createdAt: string; updatedAt: string }>

List comments on a GitHub issue.

Parameters and return value
ParameterTypeDetails
ownerstring—
repostring—
issueNumbernumber—
maxResultsOptionalnumber—

Returns Promise<Array<{ id: number; body: string; user: string | null; htmlUrl: string; createdAt: string; updatedAt: string }>>

Add labels to a GitHub issue. Returns the full list of labels on the issue.

Parameters and return value
ParameterTypeDetails
ownerstring—
repostring—
issueNumbernumber—
labelsstring[]—

Returns Promise<string[]>

List pull requests for a GitHub repository. State: 'open', 'closed', 'all'. head/base filter by branch name.

Parameters and return value
ParameterTypeDetails
ownerstring—
repostring—
stateOptionalstring—
headOptionalstring—
baseOptionalstring—
maxResultsOptionalnumber—

Returns Promise<Array<{ id: number; number: number; title: string; body: string | null; state: string; draft: boolean; merged: boolean; head: { ref: string; sha: string }; base: { ref: string; sha: string }; user: string | null; labels: string[]; htmlUrl: string; createdAt: string; updatedAt: string }>>

Get a single pull request by number. Includes diff stats (additions, deletions, changedFiles).

Parameters and return value
ParameterTypeDetails
ownerstring—
repostring—
pullNumbernumber—

Returns Promise<{ id: number; number: number; title: string; body: string | null; state: string; draft: boolean; merged: boolean; head: { ref: string; sha: string }; base: { ref: string; sha: string }; user: string | null; labels: string[]; htmlUrl: string; additions: number; deletions: number; changedFiles: number; createdAt: string; updatedAt: string; mergedAt: string | null }>

Create a new pull request. head = source branch, base = target branch (e.g. 'main').

Parameters and return value
ParameterTypeDetails
ownerstring—
repostring—
titlestring—
headstring—
basestring—
bodyOptionalstring—
draftOptionalboolean—

Returns Promise<{ id: number; number: number; title: string; body: string | null; state: string; draft: boolean; head: { ref: string; sha: string }; base: { ref: string; sha: string }; htmlUrl: string; createdAt: string }>

Add a comment to a pull request.

Parameters and return value
ParameterTypeDetails
ownerstring—
repostring—
pullNumbernumber—
bodystring—

Returns Promise<{ id: number; body: string; user: string | null; htmlUrl: string; createdAt: string; updatedAt: string }>

List comments on a pull request.

Parameters and return value
ParameterTypeDetails
ownerstring—
repostring—
pullNumbernumber—
maxResultsOptionalnumber—

Returns Promise<Array<{ id: number; body: string; user: string | null; htmlUrl: string; createdAt: string; updatedAt: string }>>

Merge a pull request. mergeMethod: 'merge', 'squash', or 'rebase'. Defaults to 'merge'.

Parameters and return value
ParameterTypeDetails
ownerstring—
repostring—
pullNumbernumber—
mergeMethodOptionalstring—
commitTitleOptionalstring—

Returns Promise<{ merged: boolean; message: string; sha: string }>

Request reviewers for a pull request.

Parameters and return value
ParameterTypeDetails
ownerstring—
repostring—
pullNumbernumber—
reviewersstring[]—

Returns Promise<{ requestedReviewers: string[] }>

List releases for a GitHub repository, ordered by creation date (newest first).

Parameters and return value
ParameterTypeDetails
ownerstring—
repostring—
maxResultsOptionalnumber—

Returns Promise<Array<{ id: number; tagName: string; name: string | null; body: string | null; draft: boolean; prerelease: boolean; htmlUrl: string; createdAt: string; publishedAt: string | null; assets: Array<{ name: string; size: number; downloadUrl: string }> }>>

Get a specific release by ID.

Parameters and return value
ParameterTypeDetails
ownerstring—
repostring—
releaseIdnumber—

Returns Promise<{ id: number; tagName: string; name: string | null; body: string | null; draft: boolean; prerelease: boolean; htmlUrl: string; createdAt: string; publishedAt: string | null; assets: Array<{ name: string; size: number; downloadUrl: string }> }>

Create a new GitHub release. tagName is required. targetCommitish defaults to the default branch.

Parameters and return value
ParameterTypeDetails
ownerstring—
repostring—
tagNamestring—
nameOptionalstring—
bodyOptionalstring—
draftOptionalboolean—
prereleaseOptionalboolean—
targetCommitishOptionalstring—

Returns Promise<{ id: number; tagName: string; name: string | null; body: string | null; draft: boolean; prerelease: boolean; htmlUrl: string; createdAt: string; publishedAt: string | null }>

List GitHub repositories for a user or the authenticated user. Returns simplified repo objects.

Parameters and return value
ParameterTypeDetails
ownerOptionalstring—
typeOptionalstring—
sortOptionalstring—
maxResultsOptionalnumber—

Returns Promise<Array<{ id: number; name: string; fullName: string; description: string | null; private: boolean; defaultBranch: string; language: string | null; stargazersCount: number; forksCount: number; openIssuesCount: number; htmlUrl: string; createdAt: string | null; updatedAt: string | null }>>

Get details of a specific GitHub repository.

Parameters and return value
ParameterTypeDetails
ownerstring—
repostring—

Returns Promise<{ id: number; name: string; fullName: string; description: string | null; private: boolean; defaultBranch: string; language: string | null; stargazersCount: number; forksCount: number; openIssuesCount: number; htmlUrl: string; createdAt: string | null; updatedAt: string | null }>

Search GitHub repositories using GitHub search query syntax. Example: 'language:typescript stars:>100'.

Parameters and return value
ParameterTypeDetails
querystring—
maxResultsOptionalnumber—

Returns Promise<Array<{ id: number; name: string; fullName: string; description: string | null; private: boolean; defaultBranch: string; language: string | null; stargazersCount: number; forksCount: number; openIssuesCount: number; htmlUrl: string; createdAt: string | null; updatedAt: string | null }>>

List contributors for a GitHub repository.

Parameters and return value
ParameterTypeDetails
ownerstring—
repostring—
maxResultsOptionalnumber—

Returns Promise<Array<{ login: string; contributions: number; htmlUrl: string }>>