Skip to content

[pull] master from KnpLabs:master #22

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 61 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
131e597
Setup dependabot for github action workflows
acrobat Feb 5, 2023
001ef4a
minor #1098 Setup dependabot for github action workflows (acrobat)
acrobat Feb 5, 2023
782da17
Bump actions/checkout from 2 to 3
dependabot[bot] Feb 5, 2023
d120c79
Bump ramsey/composer-install from 1 to 2
dependabot[bot] Feb 5, 2023
a49f0d5
minor #1099 Bump actions/checkout from 2 to 3 (dependabot[bot])
acrobat Feb 5, 2023
31cd5b1
minor #1100 Bump ramsey/composer-install from 1 to 2 (dependabot[bot])
acrobat Feb 5, 2023
32f79ea
feature #1103 Added environments (Froxz)
SergkeiM Mar 9, 2023
799aa2b
Update changelog for 3.10.0 release
acrobat Mar 9, 2023
fcc99dd
Update branch alias
acrobat Mar 9, 2023
01bd3ee
Test on PHP 8.2
GrahamCampbell Mar 9, 2023
b335003
minor #1105 Test on PHP 8.2 (GrahamCampbell)
acrobat Mar 9, 2023
8168261
bug #1107 Bugfix creating env (Froxz)
SergkeiM Mar 9, 2023
acc0453
feature #1104 Added environment variables & secrets (Froxz)
SergkeiM Mar 10, 2023
bdb9bfb
feature #1106 Added Org & Repository variables (Froxz)
SergkeiM Mar 10, 2023
00570ac
feature #1108 Deployment branch policies (Froxz)
SergkeiM Mar 10, 2023
c68b874
Update changelog for 3.11.0 release
acrobat Mar 10, 2023
b6fe049
Fixed branch alias
GrahamCampbell Mar 10, 2023
4f7e610
minor #1109 Fixed branch alias (GrahamCampbell)
acrobat Mar 10, 2023
0e2399c
feature #1101 feat: Support for Organization Runners (haridarshan, re…
haridarshan Apr 2, 2023
d005523
Bump actions/checkout from 3 to 4
dependabot[bot] Sep 11, 2023
a9c261e
Merge pull request #1121 from KnpLabs/dependabot/github_actions/actio…
acrobat Sep 12, 2023
2a3a71b
allow psr/http-message v2
LordSimal Sep 29, 2023
ee9bc59
feature #1122 allow psr/http-message v2 (LordSimal)
acrobat Sep 30, 2023
6fd7aac
Update changelog for 3.12.0 release
acrobat Sep 30, 2023
b50fc1f
Update changelog for 3.12.0 release
acrobat Sep 30, 2023
3bac0b8
Update composer branch-alias
acrobat Sep 30, 2023
a02113f
CHANGELOG-3.X: fix release 3.12.0 mentioned twice
clxmstaab Oct 2, 2023
05b7769
Merge pull request #1123 from clxmstaab/patch-1
acrobat Oct 3, 2023
c1b440a
Test against php 8.3
sergiy-petrov Oct 10, 2023
b0ce482
feature #1124 Test against php 8.3 (sergiy-petrov)
acrobat Oct 17, 2023
113f6b3
feature #1114 feat: Secret Scanning Alerts (haridarshan)
haridarshan Oct 17, 2023
14e8eed
Switch roave bc-checker from docker to local setup
acrobat Oct 17, 2023
10080cd
Apply style-ci fixes
acrobat Oct 17, 2023
90360bc
minor #1125 General chores (acrobat)
acrobat Oct 17, 2023
67398b0
feature #1115 feat: User Migration (haridarshan)
haridarshan Oct 17, 2023
9d19af3
bug #1126 Fix detection of secondary rate limit (mathieudz)
mathieudz Nov 19, 2023
47024f3
Update changelog for 3.13.0 release
acrobat Nov 19, 2023
9afaf87
Update composer branch-alias
acrobat Nov 19, 2023
6f5b61d
Bump ramsey/composer-install from 2 to 3
dependabot[bot] Mar 4, 2024
680eea2
Allow php-http/cache-plugin v2
GrahamCampbell Mar 17, 2024
5d66b9c
feature #1134 Allow php-http/cache-plugin v2 (GrahamCampbell)
acrobat Mar 19, 2024
16235d0
Update changelog for 3.14.0 release
acrobat Mar 19, 2024
4fca25f
Update composer branch-alias
acrobat Mar 19, 2024
4afaaf9
Apply fixes from StyleCI
StyleCIBot Mar 24, 2024
1465bf3
Merge pull request #1136 from KnpLabs/analysis-yrov1o
acrobat Mar 24, 2024
a162dd3
Merge pull request #1133 from KnpLabs/dependabot/github_actions/ramse…
acrobat Mar 24, 2024
61b478a
bug #1135 Handle case of GitHub returning 204 No Content in some scen…
tomcorbett Mar 24, 2024
71fec50
Update changelog for 3.14.1 release
acrobat Mar 24, 2024
773747a
Fix type error in ResultPager::fetch
nunoplopes Mar 25, 2024
1f77a93
Add API endpoints to interact with organiztion roles
glaubinix Sep 16, 2024
00ab97b
feature #1144 Fix implicit nullable types to avoid PHP 8.4 warnings (…
eiriksm Sep 23, 2024
f8f6a95
feature #1143 Add API endpoints to interact with organization roles (…
acrobat Sep 23, 2024
a6f0f4f
feature #1142 Copilot Usage Endpoints (anthony-webart)
anthony-webart Sep 23, 2024
3db6f27
feature #1132 Fix type error in ResultPager::fetch (nunoplopes)
acrobat Sep 23, 2024
d4b7a1c
Update changelog for 3.15.0 release
acrobat Sep 23, 2024
845545b
Update composer branch-alias
acrobat Sep 23, 2024
48e025e
Add API to rerequest a check run
Spea Aug 17, 2024
055cf51
feature #1141 Add API to rerequest a check run (Spea)
acrobat Sep 26, 2024
d72323c
feature #1146 List pull requests associated with a commit (lmjhs)
lmjhs Nov 7, 2024
25d7baf
Update changelog for 3.16.0 release
acrobat Nov 7, 2024
663af58
Update composer branch-alias
acrobat Nov 7, 2024
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
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
14 changes: 10 additions & 4 deletions .github/workflows/backwards-compatibility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,17 @@ jobs:
name: "Roave BC check"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Roave BC Check
uses: docker://nyholm/roave-bc-check-ga
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
args: --from=${{ github.event.pull_request.base.sha }}
php-version: '8.2'

- name: Install roave/backward-compatibility-check
run: composer require --dev roave/backward-compatibility-check

- name: Run roave/backward-compatibility-check
run: vendor/bin/roave-backward-compatibility-check --from=${{ github.event.pull_request.base.sha }} --format=github-actions
12 changes: 7 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ jobs:
strategy:
fail-fast: false
matrix:
php-versions: ['7.2', '7.3', '7.4', '8.0', '8.1']
php-versions: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4']

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand All @@ -23,25 +23,27 @@ jobs:
coverage: none

- name: Install Composer Dependencies
uses: ramsey/composer-install@v1
uses: ramsey/composer-install@v3

- name: Run phpunit
run: vendor/bin/phpunit --verbose
env:
SYMFONY_DEPRECATIONS_HELPER: 'max[self]=0'

phpstan:
name: PHPStan
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- uses: shivammathur/setup-php@v2
with:
php-version: 7.2
coverage: none

- name: Install Composer Dependencies
uses: ramsey/composer-install@v1
uses: ramsey/composer-install@v3

- name: Run phpstan
run: vendor/bin/phpstan analyse --no-progress
71 changes: 71 additions & 0 deletions CHANGELOG-3.X.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,76 @@
# Changelog

## 3.16.0

### Added
- Add API to rerequest a check run ([Spea](https://github.com/Spea)) [#1141](https://github.com/KnpLabs/php-github-api/issues/1141)
- List pull requests associated with a commit ([lmjhs](https://github.com/lmjhs)) [#1146](https://github.com/KnpLabs/php-github-api/issues/1146)

## 3.15.0

### Added
- Fix implicit nullable types to avoid PHP 8.4 warnings ([eiriksm](https://github.com/eiriksm), [acrobat](https://github.com/acrobat)) [#1144](https://github.com/KnpLabs/php-github-api/issues/1144)
- Add API endpoints to interact with organization roles ([glaubinix](https://github.com/glaubinix)) [#1143](https://github.com/KnpLabs/php-github-api/issues/1143)
- Copilot Usage Endpoints ([anthony-webart](https://github.com/anthony-webart)) [#1142](https://github.com/KnpLabs/php-github-api/issues/1142)
- Fix type error in ResultPager::fetch ([nunoplopes](https://github.com/nunoplopes)) [#1132](https://github.com/KnpLabs/php-github-api/issues/1132)

## 3.14.1

### Fixed
- Handle case of GitHub returning 204 No Content in some scenarios ([tomcorbett](https://github.com/tomcorbett)) [#1135](https://github.com/KnpLabs/php-github-api/issues/1135)

## 3.14.0

### Added
- Allow php-http/cache-plugin v2 ([GrahamCampbell](https://github.com/GrahamCampbell)) [#1134](https://github.com/KnpLabs/php-github-api/issues/1134)

## 3.13.0

### Added
- Test against php 8.3 ([sergiy-petrov](https://github.com/sergiy-petrov)) [#1124](https://github.com/KnpLabs/php-github-api/issues/1124)
- feat: Secret Scanning Alerts ([haridarshan](https://github.com/haridarshan)) [#1114](https://github.com/KnpLabs/php-github-api/issues/1114)
- feat: User Migration ([haridarshan](https://github.com/haridarshan)) [#1115](https://github.com/KnpLabs/php-github-api/issues/1115)

### Changed
- General chores ([acrobat](https://github.com/acrobat)) [#1125](https://github.com/KnpLabs/php-github-api/issues/1125)

### Fixed
- Fix detection of secondary rate limit ([mathieudz](https://github.com/mathieudz)) [#1126](https://github.com/KnpLabs/php-github-api/issues/1126)

## 3.12.0

### Added
- feat: Support for Organization Runners ([haridarshan](https://github.com/haridarshan), [renovate](https://github.com/renovate)[[bot](https://github.com/bot)]) [#1101](https://github.com/KnpLabs/php-github-api/issues/1101)
- allow psr/http-message v2 ([LordSimal](https://github.com/LordSimal)) [#1122](https://github.com/KnpLabs/php-github-api/issues/1122)

### Changed
- Fixed branch alias ([GrahamCampbell](https://github.com/GrahamCampbell)) [#1109](https://github.com/KnpLabs/php-github-api/issues/1109)

## 3.11.0

### Added
- Added environment variables & secrets ([Froxz](https://github.com/Froxz)) [#1104](https://github.com/KnpLabs/php-github-api/issues/1104)
- Added Org & Repository variables ([Froxz](https://github.com/Froxz)) [#1106](https://github.com/KnpLabs/php-github-api/issues/1106)
- Deployment branch policies ([Froxz](https://github.com/Froxz)) [#1108](https://github.com/KnpLabs/php-github-api/issues/1108)

### Changed
- Test on PHP 8.2 ([GrahamCampbell](https://github.com/GrahamCampbell)) [#1105](https://github.com/KnpLabs/php-github-api/issues/1105)

### Fixed
- Bugfix creating env ([Froxz](https://github.com/Froxz)) [#1107](https://github.com/KnpLabs/php-github-api/issues/1107)

## 3.10.0

### Added
- Add vulnerability alerts endpoints ([andreia](https://github.com/andreia)) [#1096](https://github.com/KnpLabs/php-github-api/issues/1096)
- Added environments ([Froxz](https://github.com/Froxz)) [#1103](https://github.com/KnpLabs/php-github-api/issues/1103)

### Changed
- Create authorization removed from docs ([rafasashi](https://github.com/rafasashi)) [#1090](https://github.com/KnpLabs/php-github-api/issues/1090)
- Setup dependabot for github action workflows ([acrobat](https://github.com/acrobat)) [#1098](https://github.com/KnpLabs/php-github-api/issues/1098)
- Bump actions/checkout from 2 to 3 ([dependabot](https://github.com/dependabot)[[bot](https://github.com/bot)]) [#1099](https://github.com/KnpLabs/php-github-api/issues/1099)
- Bump ramsey/composer-install from 1 to 2 ([dependabot](https://github.com/dependabot)[[bot](https://github.com/bot)]) [#1100](https://github.com/KnpLabs/php-github-api/issues/1100)

## 3.9.0

### Added
Expand Down
11 changes: 6 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,21 @@
"require": {
"php": "^7.2.5 || ^8.0",
"ext-json": "*",
"php-http/cache-plugin": "^1.7.1",
"php-http/cache-plugin": "^1.7.1|^2.0",
"php-http/client-common": "^2.3",
"php-http/discovery": "^1.12",
"php-http/httplug": "^2.2",
"php-http/multipart-stream-builder": "^1.1.2",
"psr/cache": "^1.0|^2.0|^3.0",
"psr/http-client-implementation": "^1.0",
"psr/http-factory-implementation": "^1.0",
"psr/http-message": "^1.0",
"psr/http-message": "^1.0|^2.0",
"symfony/polyfill-php80": "^1.17",
"symfony/deprecation-contracts": "^2.2|^3.0"
},
"require-dev": {
"symfony/cache": "^5.1.8",
"guzzlehttp/psr7": "^1.7",
"guzzlehttp/psr7": "^2.7",
"http-interop/http-factory-guzzle": "^1.0",
"guzzlehttp/guzzle": "^7.2",
"php-http/mock-client": "^1.4.1",
Expand All @@ -52,13 +52,14 @@
"extra": {
"branch-alias": {
"dev-2.x": "2.20.x-dev",
"dev-master": "3.9.x-dev"
"dev-master": "3.16-dev"
}
},
"config": {
"allow-plugins": {
"phpstan/extension-installer": true,
"composer/package-versions-deprecated": true
"composer/package-versions-deprecated": true,
"php-http/discovery": true
}
}
}
13 changes: 13 additions & 0 deletions doc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ v3 APIs:
* [Public keys](currentuser/publickeys.md)
* [Memberships](currentuser/memberships.md)
* [Enterprise](enterprise.md)
* [Secret Scanning Alert](enterprise/secret-scanning.md)
* [Gists](gists.md)
* [Comments](gists/comments.md)
* GitData
Expand All @@ -39,6 +40,11 @@ v3 APIs:
* [Organization](organization.md)
* [Members](organization/members.md)
* [Teams](organization/teams.md)
* [Self hosted runners](organization/actions/self_hosted_runners.md)
* [Secrets](organization/actions/secrets.md)
* [Variables](organization/actions/variables.md)
* [Secret Scanning Alert](organization/secret-scanning.md)
* [Organization Roles](organization/organization-roles.md)
* [Projects](project/projects.md)
* [Columns](project/columns.md)
* [Cards](project/cards.md)
Expand All @@ -51,6 +57,7 @@ v3 APIs:
* Actions
* [Artifacts](repo/actions/artifacts.md)
* [Secrets](repo/actions/secrets.md)
* [Variables](repo/actions/variables.md)
* [Self hosted runners](repo/actions/self_hosted_runners.md)
* [Workflow jobs](repo/actions/workflow_jobs.md)
* [Workflow runs](repo/actions/workflow_runs.md)
Expand All @@ -59,15 +66,21 @@ v3 APIs:
* [Check Suites](repo/check_suites.md)
* [Contents](repo/contents.md)
* [Deployments](repo/deployments.md)
* [Policies](repo/deployments/policies.md)
* [Environments](repo/deployments/environments.md)
* [Secrets](repo/deployments/environment/secrets.md)
* [Variables](repo/deployments/environment/variables.md)
* [Labels](repo/labels.md)
* [Protection](repo/protection.md)
* [Releases](repo/releases.md)
* [Assets](repo/assets.md)
* [Stargazers](repo/stargazers.md)
* [Statuses](repo/statuses.md)
* [Tags](repo/tags.md)
* [Secret Scanning Alert](repo/secret-scanning.md)
* [Search](search.md)
* [Users](users.md)
* [Migrations](user/migration.md)

Additional features:

Expand Down
8 changes: 8 additions & 0 deletions doc/commits.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,11 @@ $commit = $client->api('repo')->commits()->compare('KnpLabs', 'php-github-api',
```

Returns an array of commits.

### List pull requests associated with a commit

```php
$commit = $client->api('repo')->commits()->pulls('KnpLabs', 'php-github-api', '839e5185da9434753db47959bee16642bb4f2ce4');
```

Returns an array of pull requests.
80 changes: 80 additions & 0 deletions doc/copilot/usage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# Copilot Usage API Documentation
[Back to the navigation](../README.md)

## Overview

The Copilot Usage API provides endpoints to retrieve usage summaries for organizations and enterprises.

**Note**: This endpoint is in beta and is subject to change.

## Endpoints

### Organization Usage Summary

Retrieve the usage summary for a specific organization.

**Method:** `GET`

**Endpoint:** `/orgs/{organization}/copilot/usage`

**Parameters:**
- `organization` (string): The name of the organization.
- `params` (array, optional): Additional query parameters.

**Example:**
```php
$usage = $client->api('copilotUsage')->orgUsageSummary('KnpLabs');
```

### Organization Team Usage Summary

Retrieve the usage summary for a specific team within an organization.

**Method:** `GET`

**Endpoint:** `/orgs/{organization}/team/{team}/copilot/usage`

**Parameters:**
- `organization` (string): The name of the organization.
- `team` (string): The name of the team.
- `params` (array, optional): Additional query parameters.

**Example:**
```php
$usage = $client->api('copilotUsage')->orgTeamUsageSummary('KnpLabs', 'developers');
```

### Enterprise Usage Summary

Retrieve the usage summary for a specific enterprise.

**Method:** `GET`

**Endpoint:** `/enterprises/{enterprise}/copilot/usage`

**Parameters:**
- `enterprise` (string): The name of the enterprise.
- `params` (array, optional): Additional query parameters.

**Example:**
```php
$usage = $client->api('copilotUsage')->enterpriseUsageSummary('KnpLabs');
```

### Enterprise Team Usage Summary

Retrieve the usage summary for a specific team within an enterprise.

**Method:** `GET`

**Endpoint:** `/enterprises/{enterprise}/team/{team}/copilot/usage`

**Parameters:**
- `enterprise` (string): The name of the enterprise.
- `team` (string): The name of the team.
- `params` (array, optional): Additional query parameters.

**Example:**
```php
$usage = $client->api('copilotUsage')->enterpriseTeamUsageSummary('KnpLabs', 'developers');
```
10 changes: 10 additions & 0 deletions doc/enterprise/secret-scanning.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
## Enterprise / Secret Scanning API
[Back to the "Enterprise API"](../../enterprise.md) | [Back to the navigation](../../README.md)

# List secret-scanning alerts for an Enterprise

https://docs.github.com/en/enterprise-server@3.5/rest/secret-scanning#list-secret-scanning-alerts-for-an-enterprise

```php
$alerts = $client->api('enterprise')->secretScanning()->alerts('KnpLabs');
```
51 changes: 51 additions & 0 deletions doc/organization/actions/self_hosted_runners.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
## Organization / Actions / Self Hosted Runners API
[Back to the "Organization API"](../../organization.md) | [Back to the navigation](../../README.md)

# List self-hosted runners for an Organization

https://docs.github.com/en/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-self-hosted-runners-for-an-organization

```php
$runners = $client->api('organization')->runners()->all('KnpLabs');
```

# Get a self-hosted runner for an Organization

https://docs.github.com/en/rest/actions/self-hosted-runners?apiVersion=2022-11-28#get-a-self-hosted-runner-for-an-organization

```php
$runner = $client->api('organization')->runners()->show('KnpLabs', $runnerId);
```

# Delete a self-hosted runner from an Organization

https://docs.github.com/en/rest/actions/self-hosted-runners?apiVersion=2022-11-28#delete-a-self-hosted-runner-from-an-organization

```php
$client->api('organization')->runners()->remove('KnpLabs', $runnerId);
```

# List runner applications for an Organization

https://docs.github.com/en/rest/actions/self-hosted-runners?apiVersion=2022-11-28#list-runner-applications-for-an-organization

```php
$applications = $client->api('organization')->selfHostedRunners()->applications('KnpLabs');
```

# List of all runners with Pagination

```php
$api = $github->api('organization')->runners();
$paginator = new Github\ResultPager($github);
$parameters = array('KnpLabs');
$runners = $paginator->fetchAll($api, 'all', $parameters);

do {
foreach ($runners['runners'] as $runner) {
// code
}
$runners = $paginator->fetchNext();
}
while($paginator->hasNext());
```
Loading