Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .claude/CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ Notes for working in this repository.

A Laravel package that calls the GitHub REST API with Saloon. Resources live in `src/Resources` and build request classes in `src/Requests`. Responses are mapped by `createDtoFromResponse()` onto plain PHP objects in `src/Data`. Those objects are not Spatie Laravel Data objects.

The facade `JordanPartridge\GithubClient\Facades\Github` resolves `JordanPartridge\GithubClient\Github`. Inject that class. There is no `GithubConnectorInterface`.
The facade `ShadeTheory\GithubClient\Facades\Github` resolves `ShadeTheory\GithubClient\Github`. Inject that class. There is no `GithubConnectorInterface`.

The connector is `JordanPartridge\GithubClient\Connectors\GithubConnector`. Its base URL is `https://api.github.com`.
The connector is `ShadeTheory\GithubClient\Connectors\GithubConnector`. Its base URL is `https://api.github.com`.

## Commands

Expand Down
18 changes: 9 additions & 9 deletions .claude/agents/github-repo-maintainer.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Automatically categorize, label, and prioritize incoming issues based on content
### Example

```php
use JordanPartridge\GithubClient\Facades\Github;
use ShadeTheory\GithubClient\Facades\Github;

// Fetch new issues without labels
$issues = Github::issues()->all('owner/repo', state: 'open');
Expand Down Expand Up @@ -96,7 +96,7 @@ Perform automated code review checks on incoming pull requests.
### Example

```php
use JordanPartridge\GithubClient\Facades\Github;
use ShadeTheory\GithubClient\Facades\Github;

// Get open PRs ready for review
$pulls = Github::pulls()->all('owner/repo', state: 'open');
Expand Down Expand Up @@ -178,7 +178,7 @@ Detect and help resolve merge conflicts in pull requests.
### Example

```php
use JordanPartridge\GithubClient\Facades\Github;
use ShadeTheory\GithubClient\Facades\Github;

// Find PRs with merge conflicts
$pulls = Github::pulls()->all('owner/repo', state: 'open');
Expand Down Expand Up @@ -258,7 +258,7 @@ Automate the release process including changelog generation and version tagging.
### Example

```php
use JordanPartridge\GithubClient\Facades\Github;
use ShadeTheory\GithubClient\Facades\Github;

// Get the latest release
$releases = Github::releases()->all('owner/repo');
Expand Down Expand Up @@ -371,7 +371,7 @@ Identify and manage stale issues and pull requests to keep the repository clean.
### Example

```php
use JordanPartridge\GithubClient\Facades\Github;
use ShadeTheory\GithubClient\Facades\Github;
use Carbon\Carbon;

$staleDays = 30;
Expand Down Expand Up @@ -452,7 +452,7 @@ Monitor and respond to dependency security vulnerabilities.
### Example

```php
use JordanPartridge\GithubClient\Facades\Github;
use ShadeTheory\GithubClient\Facades\Github;
use Illuminate\Support\Facades\Process;

// Run composer audit to check for vulnerabilities
Expand Down Expand Up @@ -604,9 +604,9 @@ protected function schedule(Schedule $schedule)
All skills should implement proper error handling:

```php
use JordanPartridge\GithubClient\Exceptions\RateLimitException;
use JordanPartridge\GithubClient\Exceptions\AuthenticationException;
use JordanPartridge\GithubClient\Exceptions\ApiException;
use ShadeTheory\GithubClient\Exceptions\RateLimitException;
use ShadeTheory\GithubClient\Exceptions\AuthenticationException;
use ShadeTheory\GithubClient\Exceptions\ApiException;

try {
$result = Github::issues()->all('owner/repo');
Expand Down
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html

# Ignore all test and documentation with "export-ignore".
.agents/ export-ignore
.claude/ export-ignore
.claude/agents/ export-ignore
.claude/CLAUDE.md export-ignore
Expand Down
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github: JordanPartridge
github: shadetheory
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
blank_issues_enabled: false
contact_links:
- name: Ask a question
url: https://github.com/jordanpartridge/github-client/discussions/new?category=q-a
url: https://github.com/shadetheory/github-client/discussions/new?category=q-a
about: Ask the community for help
- name: Request a feature
url: https://github.com/jordanpartridge/github-client/discussions/new?category=ideas
url: https://github.com/shadetheory/github-client/discussions/new?category=ideas
about: Share ideas for new features
- name: Report a security issue
url: https://github.com/jordanpartridge/github-client/security/policy
url: https://github.com/shadetheory/github-client/security/policy
about: Learn how to notify us for sensitive bugs
2 changes: 1 addition & 1 deletion .github/workflows/devnull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
RELEASE_BODY: ${{ github.event.release.body }}
RELEASE_URL: ${{ github.event.release.html_url }}
PITCH: 'A Laravel client for GitHub''s REST API, built on Saloon, covering repositories, issues, pull requests, commits, releases and Actions, with token or GitHub App auth.'
PACKAGE: 'jordanpartridge/github-client'
PACKAGE: 'shadetheory/github-client'
SELF_JOBS: compose,post
run: |
body="$(python3 .github/scripts/devnull-post.py)"
Expand Down
10 changes: 8 additions & 2 deletions .roave-backward-compatibility-check.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Baseline for roave/backward-compatibility-check.
Only ignores changes that come from the Symfony and Laravel console base classes
that the package commands extend, not changes to this package's own API.

Console ignores cover method removals inherited from Symfony and Laravel
console base classes, not changes to this package's own API.

The JordanPartridge\GithubClient class removals are the approved rename to
ShadeTheory\GithubClient. Tags from before that rename compare as deletions.
This pattern does not match classes under the new namespace.
-->
<roave-bc-check
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/Roave/BackwardCompatibilityCheck/8.27.x/Resources/schema.xsd">
<baseline>
<ignored-regex>#\[BC\] REMOVED: Method [^ ]+ \(inherited from (Symfony\\Component\\Console|Illuminate\\Console)\\[^)]+\) was removed#</ignored-regex>
<ignored-regex>#\[BC\] CHANGED: The return type of (Symfony\\Component\\Console|Illuminate\\Console)\\[^ ]+\#[A-Za-z_]+\(\) changed from no type to void#</ignored-regex>
<ignored-regex>#\[BC\] REMOVED: Class JordanPartridge\\GithubClient\\.* has been deleted#</ignored-regex>
</baseline>
</roave-bc-check>
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ All notable changes to `github-client` will be documented in this file.

## Unreleased

* **Breaking:** Composer package renamed from `jordanpartridge/github-client` to `shadetheory/github-client`. PHP namespace renamed from `JordanPartridge\GithubClient` to `ShadeTheory\GithubClient`, including PSR-4 autoload, the Laravel service provider, and the `Github` facade alias. Install with `composer require shadetheory/github-client`.

## v3.1.0 - 2026-10-21

* GitHub App authentication: `Github::forInstallation()`, `Github::withApp()`, and the `installations()` resource
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) JordanPartridge <jordan.l.partridge@gmail.com>
Copyright (c) shadetheory <jordan.l.partridge@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
58 changes: 29 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
A Laravel package for GitHub's REST API. It uses [Saloon](https://docs.saloon.dev) for HTTP, maps responses onto PHP objects, and exposes repositories, issues, pull requests, commits, releases, and Actions from a facade or the container.

```bash
composer require jordanpartridge/github-client
composer require shadetheory/github-client
```

[![Tests](https://img.shields.io/github/actions/workflow/status/shadetheory/github-client/run-tests.yml?branch=master&label=tests&style=flat-square)](https://github.com/shadetheory/github-client/actions/workflows/run-tests.yml)
[![PHPStan](https://img.shields.io/github/actions/workflow/status/shadetheory/github-client/phpstan.yml?branch=master&label=phpstan&style=flat-square)](https://github.com/shadetheory/github-client/actions/workflows/phpstan.yml)
[![Latest Version](https://img.shields.io/packagist/v/jordanpartridge/github-client.svg?style=flat-square)](https://packagist.org/packages/jordanpartridge/github-client)
[![Downloads](https://img.shields.io/packagist/dt/jordanpartridge/github-client.svg?style=flat-square)](https://packagist.org/packages/jordanpartridge/github-client)
[![Latest Version](https://img.shields.io/packagist/v/shadetheory/github-client.svg?style=flat-square)](https://packagist.org/packages/shadetheory/github-client)
[![Downloads](https://img.shields.io/packagist/dt/shadetheory/github-client.svg?style=flat-square)](https://packagist.org/packages/shadetheory/github-client)
[![License](https://img.shields.io/github/license/shadetheory/github-client?style=flat-square)](LICENSE.md)

`Github::forInstallation()`, `Github::withApp()`, and `installations()` are available from `v3.1.0`.
Expand All @@ -19,7 +19,7 @@ See the [documentation index](docs/README.md) for the API reference, authenticat
## Install

```bash
composer require jordanpartridge/github-client
composer require shadetheory/github-client
```

Publish the config file:
Expand Down Expand Up @@ -53,11 +53,11 @@ OAuth and GitHub App settings are in the same config file. See [OAuth](#oauth) a
## Usage

```php
use JordanPartridge\GithubClient\Facades\Github;
use ShadeTheory\GithubClient\Facades\Github;

$repos = Github::repos()->all()->dto();

$repo = Github::getRepo('jordanpartridge/github-client');
$repo = Github::getRepo('shadetheory/github-client');

echo $repo->name;
echo $repo->stargazers_count;
Expand All @@ -69,9 +69,9 @@ echo $repo->owner->login;
`repos()->get()` takes a `Repo` value object, not a string:

```php
use JordanPartridge\GithubClient\ValueObjects\Repo;
use ShadeTheory\GithubClient\ValueObjects\Repo;

$repo = Github::repos()->get(Repo::fromFullName('jordanpartridge/github-client'));
$repo = Github::repos()->get(Repo::fromFullName('shadetheory/github-client'));
```

`repos()->delete()` takes the same value object and returns the Saloon response.
Expand All @@ -81,9 +81,9 @@ $repo = Github::repos()->get(Repo::fromFullName('jordanpartridge/github-client')
`all()` requests one page (GitHub's default is 30). `allWithPagination()` follows the `Link` header and returns every `RepoData` it can fetch, up to 1000 pages.

```php
use JordanPartridge\GithubClient\Enums\Direction;
use JordanPartridge\GithubClient\Enums\Sort;
use JordanPartridge\GithubClient\Enums\Visibility;
use ShadeTheory\GithubClient\Enums\Direction;
use ShadeTheory\GithubClient\Enums\Sort;
use ShadeTheory\GithubClient\Enums\Visibility;

$repos = Github::repos()->allWithPagination(
visibility: Visibility::PUBLIC,
Expand All @@ -95,32 +95,32 @@ $repos = Github::repos()->allWithPagination(
### Issues

```php
use JordanPartridge\GithubClient\Enums\Issues\State;
use ShadeTheory\GithubClient\Enums\Issues\State;

$issue = Github::issues()->create(
owner: 'jordanpartridge',
owner: 'shadetheory',
repo: 'github-client',
title: 'Bug: Something broke',
body: 'Here are the details...',
labels: ['bug'],
assignees: ['jordanpartridge'],
assignees: ['shadetheory'],
);

echo $issue->number;
echo $issue->html_url;

$bugs = Github::issues()->forRepo(
owner: 'jordanpartridge',
owner: 'shadetheory',
repo: 'github-client',
state: State::OPEN,
labels: 'bug',
)->dto();

$comments = Github::issues()->comments('jordanpartridge', 'github-client', $issue->number);
$comments = Github::issues()->comments('shadetheory', 'github-client', $issue->number);

Github::issues()->addComment('jordanpartridge', 'github-client', $issue->number, 'Fixed in the latest release.');
Github::issues()->addComment('shadetheory', 'github-client', $issue->number, 'Fixed in the latest release.');

Github::issues()->close('jordanpartridge', 'github-client', $issue->number);
Github::issues()->close('shadetheory', 'github-client', $issue->number);
```

`forRepo()` and `all()` return a Saloon response. Call `dto()` for `IssueDTO` objects. `allForRepo()` paginates the same way `allWithPagination()` does and returns the array itself.
Expand All @@ -132,10 +132,10 @@ GitHub's issue list includes pull requests. List endpoints skip items that have
### Pull requests

```php
use JordanPartridge\GithubClient\Enums\MergeMethod;
use ShadeTheory\GithubClient\Enums\MergeMethod;

$pr = Github::pullRequests()->create(
owner: 'jordanpartridge',
owner: 'shadetheory',
repo: 'github-client',
title: 'Add a feature',
head: 'feature-branch',
Expand All @@ -145,7 +145,7 @@ $pr = Github::pullRequests()->create(
);

$merged = Github::pullRequests()->merge(
owner: 'jordanpartridge',
owner: 'shadetheory',
repo: 'github-client',
number: $pr->number,
mergeMethod: MergeMethod::Squash,
Expand Down Expand Up @@ -254,10 +254,10 @@ The package does not retry rate-limited calls. A rate limit response throws `Rat

## Dependency injection

The container binds `JordanPartridge\GithubClient\Github`. There is no connector interface.
The container binds `ShadeTheory\GithubClient\Github`. There is no connector interface.

```php
use JordanPartridge\GithubClient\Github;
use ShadeTheory\GithubClient\Github;

class RepoListing
{
Expand All @@ -283,8 +283,8 @@ GITHUB_REDIRECT_URL=https://example.com/auth/github/callback
```

```php
use JordanPartridge\GithubClient\Connectors\GithubConnector;
use JordanPartridge\GithubClient\Facades\GithubOAuth;
use ShadeTheory\GithubClient\Connectors\GithubConnector;
use ShadeTheory\GithubClient\Facades\GithubOAuth;

$state = bin2hex(random_bytes(16));

Expand All @@ -298,14 +298,14 @@ $token = GithubOAuth::getAccessToken($request->string('code'));

$github = new GithubConnector($token);
$repos = $github->send(
new \JordanPartridge\GithubClient\Requests\Repos\Index(),
new \ShadeTheory\GithubClient\Requests\Repos\Index(),
);
```

To keep using the facade-style resources with that token, build a client around the connector:

```php
$github = new \JordanPartridge\GithubClient\Github(new GithubConnector($token));
$github = new \ShadeTheory\GithubClient\Github(new GithubConnector($token));

$repos = $github->repos()->all()->dto();
```
Expand All @@ -324,7 +324,7 @@ GITHUB_APP_PRIVATE_KEY="-----BEGIN RSA PRIVATE KEY-----\n...\n-----END RSA PRIVA
`GITHUB_APP_PRIVATE_KEY_PATH` is used when `GITHUB_APP_PRIVATE_KEY` is empty. The path may be absolute or relative to the Laravel base path.

```php
use JordanPartridge\GithubClient\Facades\Github;
use ShadeTheory\GithubClient\Facades\Github;

$github = Github::forInstallation(12345678);

Expand Down Expand Up @@ -358,7 +358,7 @@ php artisan github-client commits --repo=laravel/framework --limit=10
Mock the connector with Saloon. The test suite blocks unmocked Saloon network requests; no GitHub credentials are needed. `IssueDTO` reads a full issue payload, including `user`. A short fixture will throw while mapping. `tests/TestCase.php` builds a complete one, and `tests/DocumentationExamplesTest.php` covers README examples.

```php
use JordanPartridge\GithubClient\Facades\Github;
use ShadeTheory\GithubClient\Facades\Github;
use Saloon\Http\Faking\MockClient;
use Saloon\Http\Faking\MockResponse;

Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "jordanpartridge/github-client",
"name": "shadetheory/github-client",
"description": "Laravel client for the GitHub REST API, built with Saloon. Typed responses for repositories, issues, pull requests, commits, releases, and Actions.",
"keywords": [
"laravel",
Expand Down Expand Up @@ -45,12 +45,12 @@
},
"autoload": {
"psr-4": {
"JordanPartridge\\GithubClient\\": "src/"
"ShadeTheory\\GithubClient\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"JordanPartridge\\GithubClient\\Tests\\": "tests/",
"ShadeTheory\\GithubClient\\Tests\\": "tests/",
"Workbench\\App\\": "workbench/app/"
}
},
Expand Down Expand Up @@ -82,10 +82,10 @@
"extra": {
"laravel": {
"providers": [
"JordanPartridge\\GithubClient\\GithubClientServiceProvider"
"ShadeTheory\\GithubClient\\GithubClientServiceProvider"
],
"aliases": {
"Github": "JordanPartridge\\GithubClient\\Facades\\Github"
"Github": "ShadeTheory\\GithubClient\\Facades\\Github"
}
}
},
Expand Down
6 changes: 3 additions & 3 deletions docs/ARCHITECTURE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Architecture

`jordanpartridge/github-client` is a Laravel package for the GitHub REST API. It is built on [Saloon](https://docs.saloon.dev) and returns typed PHP objects instead of raw arrays. It requires PHP 8.2 or newer and Laravel 11, 12, or 13. CI runs the suite on PHP 8.2, 8.3, and 8.4.
`shadetheory/github-client` is a Laravel package for the GitHub REST API. It is built on [Saloon](https://docs.saloon.dev) and returns typed PHP objects instead of raw arrays. It requires PHP 8.2 or newer and Laravel 11, 12, or 13. CI runs the suite on PHP 8.2, 8.3, and 8.4.

## Layers

Expand Down Expand Up @@ -59,8 +59,8 @@ $github->pullRequests()->all('owner', 'repo');
## Usage

```php
use JordanPartridge\GithubClient\Facades\Github;
use JordanPartridge\GithubClient\Enums\MergeMethod;
use ShadeTheory\GithubClient\Facades\Github;
use ShadeTheory\GithubClient\Enums\MergeMethod;

$repo = Github::getRepo('laravel/framework'); // RepoData
$prs = Github::pullRequests()->all('laravel', 'framework');
Expand Down
Loading
Loading