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

# GitHub

> GitHub provider allows integration with GitHub for managing repositories, issues, pull requests, and more.

## Authentication

This provider requires authentication.

* **access\_token**: GitHub Access Token (required: True, sensitive: True)

## In workflows

This provider can be used in workflows.

As "step" to query data, example:

```yaml theme={null}
steps:
    - name: Query github
      provider: github
      config: "{{ provider.my_provider_name }}"
      with:
        repository: {value}  
        previous_stars_count: {value}  
        last_stargazer: {value}  
```

As "action" to make changes or update data, example:

```yaml theme={null}
actions:
    - name: Query github
      provider: github
      config: "{{ provider.my_provider_name }}"
      with:
        run_action: {value}  # The action to run.
        workflow: {value}  # The workflow to run.
        repo_name: {value}  # The repository name.
        repo_owner: {value}  # The repository owner.
        ref: {value}  # The ref to use.
        inputs: {value}  # The inputs to use.
```

Check the following workflow examples:

* [datadog-log-monitor.yml](https://github.com/keephq/keep/blob/main/examples/workflows/datadog-log-monitor.yml)
* [db\_disk\_space\_monitor.yml](https://github.com/keephq/keep/blob/main/examples/workflows/db_disk_space_monitor.yml)
* [new\_github\_stars.yml](https://github.com/keephq/keep/blob/main/examples/workflows/new_github_stars.yml)
* [run-github-workflow.yaml](https://github.com/keephq/keep/blob/main/examples/workflows/run-github-workflow.yaml)
* [service-error-rate-monitor-datadog.yml](https://github.com/keephq/keep/blob/main/examples/workflows/service-error-rate-monitor-datadog.yml)
* [update\_workflows\_from\_http.yml](https://github.com/keephq/keep/blob/main/examples/workflows/update_workflows_from_http.yml)
* [zoom\_chat\_example.yml](https://github.com/keephq/keep/blob/main/examples/workflows/zoom_chat_example.yml)

## Provider Methods

The provider exposes the following [Provider Methods](/providers/provider-methods#via-ai-assistant). They are available in the [AI Assistant](/overview/ai-incident-assistant).

* **get\_last\_commits** Get the N last commits from a GitHub repository (view, scopes: no additional scopes)

  * `repository`: The GitHub repository to get the commits from.
  * `n`: The number of commits to get.
* **get\_last\_releases** Get the N last releases and their changelog from a GitHub repository (view, scopes: no additional scopes)

  * `repository`: The GitHub repository to get the releases from.
  * `n`: The number of releases to get.

## Connecting with the Provider

1. Go to your GitHub account and navigate to **Settings > Developer Settings > Personal Access Tokens**.
2. Generate a token with the required permissions (e.g., `repo`, `workflow`, etc.).
3. Copy the token and provide it as `github_token` in the provider configuration.

## Useful Links

* [GitHub REST API Documentation](https://docs.github.com/en/rest?apiVersion=2022-11-28)
