Commit Graph
218 Commits
Author SHA1 Message Date
Jirka Borovec 13e178a3ab Set line length to 120 characters (#2599) 2023-07-13 17:37:20 +02:00
Enrico Minack de80ff4b91 Add retry issue to GithubException, don't log it (#2611) 2023-07-11 16:10:42 +02:00
Trim21 f087cad3cb Add message property to GithubException (#2591) 2023-07-08 11:51:19 +02:00
Mauricio Alejandro Martínez PachecoandEnrico Minack 91b3f40f79 Add support for repo and org level actions variables (#2580)
Co-authored-by: Enrico Minack <github@enrico.minack.dev>
2023-07-07 15:29:30 +02:00
Thomas Burghout 766df993da Add missing arguments to Workflow.get_runs() (#2346)
Adds missing arguments created, exclude_pull_requests, head_sha to the query options of Workflow.get_runs().
2023-07-07 15:14:40 +02:00
950a69493f Use timezone-aware reset datetime in GithubRetry.py (#2610)
Co-authored-by: Patryk Szulczyk <patryk.szulczyk@skyscanner.net>
Co-authored-by: Enrico Minack <github@enrico.minack.dev>
2023-07-07 09:05:48 +02:00
c4c2e5273c Add github.Rate.used field (#2531)
Co-authored-by: Nikolay Yurin <yurinnick@meta.com>
Co-authored-by: Enrico Minack <github@enrico.minack.dev>
2023-07-04 09:50:00 +02:00
Trim21 8d3b905786 Remove symlinks from test data (#2588) 2023-06-30 21:46:12 +02:00
Thomas Devoogdt c5542a6ae8 Fix Branch.bypass_pull_request_allowances failing with "nil is not an object" (#2535)
Signed-off-by: Thomas Devoogdt <thomas@devoogdt.com>
2023-06-30 11:58:40 +02:00
Enrico MinackandJohn T. Wodder II 0177f7c513 Make datetime objects timezone-aware (#2565)
Comparing timestamps returned by the API with naive datetime objects (without timezone information) will raise an error. Add `tzinfo=datetime.timezone.utc` to your datetime instance.

Co-authored-by: John T. Wodder II <git@varonathe.org>
2023-06-28 21:47:48 +02:00
Enrico Minack 99155806ed Throttle requests to mitigate RateLimitExceededExceptions (#2145)
This introduces a throttling of requests to the Github REST API (1s for writes, 0.25s for reads, configurable)
to mitigate secondary rate limit errors and comply with Github's best practices:

https://docs.github.com/en/rest/guides/best-practices-for-integrators?apiVersion=2022-11-28#dealing-with-secondary-rate-limits
2023-06-28 21:38:29 +02:00
Enrico Minack 0bb72ca004 Retry retryable 403 (rate limit) (#2387) 2023-06-28 12:49:20 -04:00
Trim21 094538e10c Force Unix EOL (#2573) 2023-06-27 14:34:12 +02:00
Enrico Minack 14ae2cad4c Release 1.59.0 (#2563) 2023-06-22 19:41:10 +02:00
Enrico Minack ff3b80f8f1 Test and fix UTC issue with AppInstallationAuth (#2561) 2023-06-22 16:15:34 +02:00
Enrico Minack ea45237d3b Sync GithubIntegration __init__ arguments with github.Github (#2556)
Github and GithubIntegration now both support the same (full) set of Requester arguments.
Creating a Github instance for a Github App Installation coming from GithubIntegration uses the same
Requester arguments (except for auth).
2023-06-21 09:04:19 +02:00
Jonathan GregandEnrico Minack 517ad33654 Add Webhook Deliveries (#2508)
Co-authored-by: Enrico Minack <github@enrico.minack.dev>
2023-06-20 08:49:02 +02:00
Jeppe Fihl-PearsonandEnrico Minack 804c3107c8 Add support for workflow jobs and steps (#1951)
Co-authored-by: Enrico Minack <github@enrico.minack.dev>
2023-06-20 14:37:56 +08:00
chantra 6d4b6d1419 Add support for get_app() with App authentication (#2549)
Moves `Github.get_app()` called without `slug` parameter into `GithubIntegration`, because it needs an `AppAuth`,
and we collect all such endpoints there. Calling `Github.get_app()` without `slug` parameter is now deprecated.

Replaces `datetime.utcnow()` with `datetime.now(timezone.utc)`, as it is deprecated in Python 3.12.
2023-06-16 08:09:16 +02:00
Heitor Polidoro 6a21761e0f Allow multiline comments in PullRequest (#2540)
- change deprecated parameter position to line
- add a parameter to allow multiline comment: start_line
- add a parameter to allow comment as suggestion: as_suggestion
- add more missing parameters: side, start_side, in_reply_to, subject_type
2023-06-15 21:16:58 +02:00
Enrico Minack f291a368bb Implement AppUserAuth for Github App user tokens (#2546)
Allows to refresh Github App user token. Integrates `ApplicationOAuth` into `github.Auth`.
2023-06-14 19:40:29 +02:00
alson 0384e2fd13 Add support for environments (#2223) 2023-06-13 21:07:11 +02:00
Enrico Minack 7be3f76372 Make Requester.__createException robust against missing message and body (#2159) 2023-06-13 11:14:14 +02:00
Enrico Minack 6407512079 Fix auth issues with Installation.get_repos (#2547) 2023-06-13 08:35:47 +02:00
Jonathan Leitschuh daf62bd461 Add support for new RepositoryAdvisories API 🎉 (#2483) 2023-06-09 13:42:18 -04:00
Enrico Minack 84912a675c Make MainClass.get_app return completed GithubApp when slug is given (#2543)
Fixes slug attribute to fetch app when not set. Loads app with slug lazily, fetch complete app without slug.
2023-06-08 10:06:28 +02:00
Enrico Minack fc2d0e150a Add authentication classes, move auth logic there (#2528)
This adds argument `auth` and deprecates `login_or_token`, `password`, `jwt`, and `app_auth` arguments of `github.Github`.

This adds argument `auth` and deprecates `integration_id`, `private_key` of `github.GithubIntegration`.

This deprecates the `create_jwt` method of `github.GithubIntegration`, replaced by `github.Auth.AppAuth.create_jwt`.
2023-06-08 09:17:25 +02:00
Enrico Minack a8e7c4237d Add sort order and direction for getting comments (#2544)
Note: This is a breaking change. The order of parameters of `PullRequest.get_review_comments` has changed to match other `get_comments` methods and Github API parameter order. Users should change `PullRequest.get_review_comments(since)` to `PullRequest.get_review_comments(since=since)`.

Calling without parameter is not breaking: `PullRequest.get_review_comments()`
2023-06-07 14:50:07 +02:00
Trim21andEnrico Minack 9f52e9486a Add name filter to Repository.get_artifacts() (#2459)
Co-authored-by: Enrico Minack <github@enrico.minack.dev>
2023-06-01 14:32:55 +02:00
Sasha Chung 10816389d2 Add name, display_title and path attributes to WorkflowRun (#2397) 2023-06-01 10:41:33 +02:00
Jonathan Leitschuh b94a83cbf3 Add new create_fork arguments (#2493)
Adds support for new `create_fork` arguments:
 - `name` - To set the name of the fork on creation
 - `default_branch_only` - To only include the default branch

Signed-off-by: Jonathan Leitschuh <Jonathan.Leitschuh@gmail.com>
2023-05-23 17:40:02 +02:00
NevinsandNevins Bartolomeo e8075c41dd add ref to Deployment (#2489)
Co-authored-by: Nevins Bartolomeo <nevins@sev.co>
2023-05-23 10:23:58 -04:00
Wojciech Barczyński 49b3ae16bf Add generate_release_notes parameter to create_git_release and create_git_tag_and_release (#2417) 2023-05-23 15:53:33 +02:00
BradChengIRESSandGlenn McDonald 8c4b9465e6 Add allow_auto_merge support to Repository (#2477)
Co-authored-by: Glenn McDonald <testworksau@users.noreply.github.com>
2023-05-18 15:33:18 -04:00
Enrico Minack 17cd0b7964 Raise error on unsupported redirects, log supported redirects (#2524) 2023-05-13 20:36:08 +02:00
Juan Manuel "Kang" PérezandJuan Manuel Kang Perez e296dbdbad Add missing attributes to Branch (#2512)
Co-authored-by: Juan Manuel "Kang" Perez <devel@kangmak.es>
2023-05-09 12:06:35 +02:00
Felipe Peter bab4180fd5 Add allow_update_branch option to Organization (#2465) 2023-05-08 20:16:36 +02:00
Nicolas SchweitzerandNicolas Schweitzer 5aa544a1cf Add support for Issue.state_reason #2370 (#2392)
Co-authored-by: Nicolas Schweitzer <nicolas.schweitzer@amadeus.com>
2023-05-08 08:01:05 +02:00
Mikhail f. Shiryaev 4198dbfbac Add parameters to Repository.get_workflow_runs (#2408) 2023-05-06 17:00:09 +08:00
Enrico Minack a343100084 Fix GithubIntegration using exiring jwt (#2460) 2023-05-05 14:54:52 +02:00
Enrico Minack 822fc05cd5 Add expiration argument back to GithubIntegration.create_jwt (#2439)
* Add expiration argument back to create_jwt
2023-03-17 21:40:48 +11:00
5e27c10a31 Support full GitHub app authentication (#1986)
* Support full GitHub app authentication
 Refactor GithubIntegration class and add test case for app authentication
Add permissions and repository properties in InstallationAuthorization
Set JWT_EXPIRY=60 by default in GithubIntegration constructor
* Modify existing testcases for GithubIntegration as per the framework and add missing tests
* Provide installation ID for creating the access token instead of getting the first installation
* Add optional permissions support for installation access token
* Add lock around app authentication
* Keep compatibility for importing GithubIntegration from MainClass
* Group app authentication parameters in a class

Co-authored-by: Malik Ammar Akbar <malikammar.akbar@pfizer.com>
Co-authored-by: Enrico Minack <github@enrico.minack.dev>
2023-02-06 20:50:15 +11:00
Mikhail f. Shiryaevandgreen-green-avk 7cf3dfc18e Continue the PR #1899 (#2386)
* A property to access the `assets` field of release (#1898)

... in order to avoid extra requests.

<https://github.com/PyGithub/PyGithub/issues/1898>

* Remove comment to comply the review

* Add tests for GitRelease.assets

---------

Co-authored-by: green-green-avk <45503261+green-green-avk@users.noreply.github.com>
2023-01-31 07:44:16 +08:00
Ibrahim Hussainiandhussaiia 6c53e5442a feat: add allow_forking to Repository (#2380)
* chore(dependency): flake8 has moved to github

* feat: add allow_forking to Repository

* chore: linting

Co-authored-by: hussaiia <ibrahim.hussaini@cba.com.au>
2022-12-15 11:05:02 +08:00
Eric Nieuwland 7902351d4f Add code scanning alerts (#2227) 2022-11-09 14:59:34 +08:00
Gabriele Oliaro 3a6235b56e [WorkflowRun] - Add missing attributes (run_started_at & run_attempt), remove deprecated unicode type (#2273) 2022-10-29 11:26:24 +08:00
Marco Köpcke 0fadd6be8e Add support for repository autolink references (#2016) 2022-10-29 09:03:57 +08:00
Aleksei FedotovandAleksei Fedotov 437ff8452a Add class Artifact (#2313) (#2319)
Co-authored-by: Aleksei Fedotov <aleksei@fedotov.email>
2022-10-25 11:02:33 +08:00
b50283a7cf Create repo from template (#2090)
Co-authored-by: bagashvilit <bagashvilit@allegheny.edu>
Co-authored-by: WonjoonC <chos@allegheny.edu>
Co-authored-by: Isac Souza <isouza@daitangroup.com>
Co-authored-by: Isac Souza <isouza@daitan.com>
Co-authored-by: Liuyang Wan <tsfdye@gmail.com>
2022-10-13 09:13:31 +08:00
Liuyang Wan 7e6333da1a Fix CI (#2330) 2022-10-13 08:56:18 +08:00