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>
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.
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>
* 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
The GitHub API exposes an endpoint to rename a branch, so we should
support calling it. Sadly, there is not enough information to add
that method to the Branch class, so expose it in the Repository object.
Fixes#1901
Now that GitHub have moved their documentation from
developer.github.com, we should update our links. I have also tried to
update the call strings to their new format, but since it was done via
regex, some of them may not match exactly.
When a previous commit added support for creating secrets on repository
objects, support was not added to also remove them. Since the GitHub API
does support that, add a method to do so.
* Add initial support for Check Suites
* Add API call detail in CheckSuite.rerequest
* Update Accept header with general instead of preview
* Add 'get check runs' endpoint for CheckSuite with stubs
* Add create check suite endpoint with stub
* Update CheckSuite tests with creat check suite endpoint
* Add update check suites preferences endpoint
* Add repository preferences object and stub file
* Add update check suite preferences tests
Needed for #1621
Co-authored-by: Raju Subramanian <coder@mahesh.net>
* Add missing preview features of Deployment and Deployment Statuses API
- Enable support for deployment status states in_progress and queued
- Add arguments production_environment and transient_environment to Repository.create_deployment()
- Add attributes production_environment and transient_environment to Deployment
- Use correct type in assertion for Deployment.payload
- Fix incorrect assertion for description in Deployment.create_status()
- Add arguments environment, environment_url, auto_inactive to Deployment.create_status()
- Add attribute environment_url to DeploymentStatus
* Add CheckRun object and stub file
* Add list of check runs endpoint for Commit
* Add get check run endpoint for Repository
* Add CheckRun test file and replay data files
* Add CheckRunAnnotation object and stub file
* Add create CheckRun API endpoint to Repository
* Update and add new tests for CheckRun endpoint:
Black is very opinionated, but sometimes those opinions change. Run the
new black version across the codebase, and lock down the version used by
pre-commit so we don't get surprised like this again.
To build on the previous work supporting querying Workflows for GitHub
Actions, add a class and relevant methods to support querying runs of a
workflow.
Use typing.overload for MainClass.get_user() since it can return two
disparate types. Correct the docstring for it, as well as locking down
Sphinx to <3 due to built docs issue and drive-by link correction.
Fixes#1550
The API endpoint Repository.get_workflows() calls returns data in a list
item, not directly, leading to some head scratching when calling it
against GitHub. Re-record the replay data.