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.
- 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
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`.
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()`
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>
* 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>
* chore(dependency): flake8 has moved to github
* feat: add allow_forking to Repository
* chore: linting
Co-authored-by: hussaiia <ibrahim.hussaini@cba.com.au>
The docstring stated that `"*"` and `"none"` were valid values for the
organization, but neither was actually supported (unless your
organization was called `"none"`).
Remove the misleading information from the docstring, and add support
for passing in an actual `Organization` object, for better typing and
reliability properties.
Fixes#2116