PHPackages                             jiannei/easy-github - 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. jiannei/easy-github

AbandonedArchivedLibrary[API Development](/categories/api)

jiannei/easy-github
===================

Github Api V3 wrapper.

0103PHP

Since Feb 14Pushed 6y agoCompare

[ Source](https://github.com/Jiannei/EasyGithub)[ Packagist](https://packagist.org/packages/jiannei/easy-github)[ RSS](/packages/jiannei-easy-github/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (1)Used By (0)

 EasyGithub
============

[](#-easygithub-)

[![StyleCI](https://camo.githubusercontent.com/75ab8387980e72a3b39a5a6fad7d9473f40fe57357df5c5be54eb97def7e7a13/68747470733a2f2f6769746875622e7374796c6563692e696f2f7265706f732f3139313736313931332f736869656c643f6272616e63683d6d6173746572)](https://github.styleci.io/repos/191761913)

Installing
----------

[](#installing)

```
$ composer require jiannei/easy-github -vvv
```

Usage
-----

[](#usage)

### 测试准备

[](#测试准备)

- 在 web 服务器创建 test 目录和测试使用的 index.php 文件

```
// xxx/xxx/test/index.php
require __DIR__.'/vendor/autoload.php';

use Jiannei\EasyGithub\GithubClient;

$githubClient = new GithubClient();

```

#### 授权测试参考流程

[](#授权测试参考流程)

- `settings -> Oauth Apps -> Authorization callback URL` 配置成本地测试地址
- 访问 `https://github.com/login/oauth/authorize?client_id=YOUR_OAUTH_APP_CLINET_ID`
- 将以下测试代码添加到测试文件，访问 `index.php`，将得到授权成功返回的 access\_token

```
if (isset($_GET['code'])) {
    $response = $githubClient->api('oauthApps')->getAccessToken([
        'client_id'     => 'YOUR_OAUTH_APP_CLINET_ID',
        'client_secret' => 'YOUR_OAUTH_APP_CLINET_SECRET',
        'code'          => $_GET['code'],
    ]);
    var_export($response->body());
}else{
    echo 'testing...';
}

```

#### Github Action Secrets

[](#github-action-secrets)

- 获取 public\_key

```
// 需要事先获取到授权 $accessToken
$response = $githubClient->api('secrets')->authorize($accessToken)->publicKey("Jiannei","vuepress-blog-demo");

```

- 获取全部的 secret

```
// 需要事先获取到授权 $accessToken
$response = $githubClient->api('secrets')->authorize($accessToken)->all("Jiannei","vuepress-blog-demo");

```

- 获取指定的 secret

```
// 需要事先获取到授权 $accessToken
$response = $githubClient->api('secrets')->authorize($accessToken)->show("Jiannei","vuepress-blog-demo",'ACCESS_TOKEN');

```

- 创建或更新 secret

```
// 需要事先获取到授权 $accessToken + 获取 public_key
$keypair = [
    'key_id' => 'your key_id',// 调用获取 public_key 接口得到的 key_id
    'key' => 'your key',// 调用获取 public_key 接口得到的 key
];

$params = [
    'value' => 'hello,world',// 新增/更新的 secret 值
    'name' => 'TEST'// secret 名称
];

// $response = $githubClient->api('secrets')->authorize($accessToken)->store("Jiannei", "vuepress-blog-demo", $keypair, $params);

```

- 删除 secret（测试未通过)

```
// 需要事先获取到授权 $accessToken
$response = $githubClient->api('secrets')->authorize($accessToken)->destroy("Jiannei","vuepress-blog-demo",'TEST');

```

### For Laravel

[](#for-laravel)

Contributing
------------

[](#contributing)

You can contribute in one of three ways:

1. File bug reports using the [issue tracker](https://github.com/Jiannei/EasyGithub/issues).
2. Answer questions or fix bugs on the [issue tracker](https://github.com/Jiannei/EasyGithub/issues).
3. Contribute new features or update the wiki.

*The code contribution process is not very formal. You just need to make sure that you follow the PSR-0, PSR-1, and PSR-2 coding guidelines. Any new code contributions must be accompanied by unit tests where applicable.*

License
-------

[](#license)

MIT

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity34

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/1976f3bc442d9f7db752da3a494a9174132ea498d3338495b1978b1499032b45?d=identicon)[jiannei](/maintainers/jiannei)

---

Top Contributors

[![jiannei](https://avatars.githubusercontent.com/u/46595807?v=4)](https://github.com/jiannei "jiannei (2 commits)")

---

Tags

easy-to-usegithub-apilaravelphp

### Embed Badge

![Health badge](/badges/jiannei-easy-github/health.svg)

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

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

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