PHPackages                             kgaut/github\_api - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. kgaut/github\_api

ActiveDrupal-module[API Development](/categories/api)

kgaut/github\_api
=================

Integrates your Drupal site into gitlab using the Github API.

1.0.x-dev(4d ago)01.4kGPL-2.0+PHPPHP &gt;=7.4

Since Jul 2Pushed 4d ago1 watchersCompare

[ Source](https://github.com/kgaut/github_api)[ Packagist](https://packagist.org/packages/kgaut/github_api)[ Docs](https://github.com/kgaut/github_api)[ RSS](/packages/kgaut-github-api/feed)WikiDiscussions 1.0.x Synced 3d ago

READMEChangelogDependencies (1)Versions (2)Used By (0)

Github API
==========

[](#github-api)

A Drupal module that integrates your Drupal site with GitHub through the [KnpLabs GitHub API](https://github.com/KnpLabs/php-github-api) client. It provides a thin, injectable service around the client so you can list repositories, read and create issues, and manage sub-issues from your own Drupal code.

Requirements
------------

[](#requirements)

- Drupal `^8 || ^9 || ^10 || ^11`
- PHP `>= 7.4`
- [`knplabs/github-api`](https://github.com/KnpLabs/php-github-api) (installed automatically via Composer)

Installation
------------

[](#installation)

Install the module with Composer so its dependencies are pulled in:

```
composer require kgaut/github_api
drush en github_api
```

Configuration
-------------

[](#configuration)

1. Go to **Configuration → Web services → Github API settings**(`/admin/config/services/github_api`, route `github_api.settings_form`).
2. Generate a personal access token with the `repo` scope. The settings form provides a pre-filled link to GitHub's token creation page.
3. Paste the token into the **Token** field.
4. Optionally fill in **My GitHub username** — your GitHub login, used to auto-assign tickets (for example when creating TMA issues).
5. Save the configuration.

Usage
-----

[](#usage)

The module exposes a `github_api.api` service (class `Drupal\github_api\Api`). Inject it into your own services or load it from the container:

```
/** @var \Drupal\github_api\Api $api */
$api = \Drupal::service('github_api.api');

// List repositories accessible to the authenticated user.
$repositories = $api->listProjects();

// Read the issues of a repository.
$issues = $api->listIssues('kgaut', 'github_api');

// Show a single issue.
$issue = $api->showIssue('kgaut', 'github_api', 1);

// Create an issue, optionally assigning it to someone.
$created = $api->createIssue('kgaut', 'github_api', 'Bug title', 'Description', [
  $api->getMyUsername(),
]);

// Attach an existing issue as a sub-issue of a parent issue.
$api->addSubIssue('kgaut', 'github_api', $parentIssueNumber, $created['id']);
```

### Available methods

[](#available-methods)

MethodDescription`listProjects()`Lists the repositories of the authenticated user.`showProject($project_id)`Returns information about a repository by its id.`listIssues($owner, $repo)`Lists all issues of a repository.`showIssue($owner, $repo, $issue_id)`Returns a single issue.`createIssue($owner, $repo, $title, ...)`Creates an issue, with optional body and assignees.`updateIssue($owner, $repo, $n, $params)`Updates an issue — e.g. `['state' => 'closed']`. Returns the updated issue.`addAssignees($owner, $repo, $n, $users)`Adds assignees. Additive: existing ones are kept.`removeAssignees($owner, $repo, $n, $users)`Removes assignees. The others stay in place.`addSubIssue($owner, $repo, $parent, $id)`Attaches an issue as a sub-issue of a parent issue.`listSubIssues($owner, $repo, $parent)`Lists the sub-issues of a parent issue.`listIssueComments($owner, $repo, $n)`Lists the comments of an issue, oldest first.`createIssueComment($owner, $repo, $n, $body)`Posts a comment. ⚠️ Not idempotent.`listIssueTimeline($owner, $repo, $n)`Lists timeline events, including the commits that reference the issue.`showCommit($owner, $repo, $sha)`Returns a single commit (message, author, URL).`getMyUsername()`Returns the GitHub username configured in settings.License
-------

[](#license)

GPL-2.0-or-later. See the `composer.json` file for details.

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance99

Actively maintained with recent releases

Popularity20

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity19

Early-stage or recently created project

 Bus Factor1

Top contributor holds 94.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

4d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/98c8cc2314f3a86369098d1465b7144f6c4249e82d98c6f39fabb76bb97d396d?d=identicon)[kgaut](/maintainers/kgaut)

---

Top Contributors

[![kgaut](https://avatars.githubusercontent.com/u/736910?v=4)](https://github.com/kgaut "kgaut (18 commits)")[![claude](https://avatars.githubusercontent.com/u/81847?v=4)](https://github.com/claude "claude (1 commits)")

---

Tags

apidrupalgithub

### Embed Badge

![Health badge](/badges/kgaut-github-api/health.svg)

```
[![Health](https://phpackages.com/badges/kgaut-github-api/health.svg)](https://phpackages.com/packages/kgaut-github-api)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
