> ## Documentation Index
> Fetch the complete documentation index at: https://docs.jinba.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Github

> Automate Github tasks

## Overview

The Github tools allow you to automate various tasks related to Github repositories, issues, releases, and Actions workflows.

## Key Features

* `GITHUB_LIST_REPOSITORY_ISSUES`
  * List issues in a specified repository.
* `GITHUB_CREATE_AN_ISSUE`
  * Create a new issue in a specified repository.
* `GITHUB_LIST_RELEASES`
  * List releases from a repository, including tag names, release notes, author information, and asset URLs.
* `GITHUB_ACTIONS_RUN`
  * Trigger a GitHub Actions workflow via `workflow_dispatch`, wait for completion, and return the run status and artifacts.

## Authentication

For further details, [click here](/en/pages/credentials/github).

In your Github account, navigate to **Settings** > **Developer settings** > **Personal access tokens**. Generate a new token with the required scopes (e.g., `repo` for full control of private repositories).

**Note**: Treat API keys as sensitive information and never commit them to public repositories.

### Example: List Issues and Create an Issue

```yaml theme={null}
- name: List repository issues
  id: list_repository_issues
  tool: GITHUB_LIST_REPOSITORY_ISSUES
  config:
    - name: token
      value: "{{secrets.GITHUB_TOKEN}}"
  input:
    - name: owner
      value: nyuta01
    - name: repository
      value: cube-sl-demo
- name: Create an issue
  id: create_an_issue
  tool: GITHUB_CREATE_AN_ISSUE
  config:
    - name: token
      value: "{{secrets.GITHUB_TOKEN}}"
  input:
    - name: owner
      value: nyuta01
    - name: repository
      value: cube-sl-demo
    - name: title
      value: Test issue
    - name: body
      value: This is a test issue
- name: List releases
  id: list_releases
  tool: GITHUB_LIST_RELEASES
  config:
    - name: token
      value: "{{secrets.GITHUB_TOKEN}}"
  input:
    - name: owner
      value: nyuta01
    - name: repository
      value: cube-sl-demo
    - name: per_page
      value: 10
```

### Example: Run a GitHub Actions Workflow

`GITHUB_ACTIONS_RUN` authenticates with either a Personal Access Token (`pat_token`) or GitHub App credentials (`github_app`), selected via the `auth_type` config.

```yaml theme={null}
- name: Run workflow
  id: run_workflow
  tool: GITHUB_ACTIONS_RUN
  config:
    - name: auth_type
      value: pat_token
    - name: pat_token
      value: "{{secrets.GITHUB_TOKEN}}"
  input:
    - name: owner
      value: nyuta01
    - name: repository
      value: cube-sl-demo
    - name: workflow
      value: ci.yml
    - name: ref
      value: main
    - name: inputs
      value: '{"environment": "staging"}'
    - name: wait_timeout_seconds
      value: 1200
```
