Commit Graph
265 Commits
Author SHA1 Message Date
Trim21 294c0cc9c5 Enable mypy disallow_untyped_defs (#2609) 2023-07-14 21:47:24 +02:00
Trim21 8816889a7d Enable mypy check_untyped_defs (#2607) 2023-07-14 14:49:28 +02:00
Jirka Borovec 13e178a3ab Set line length to 120 characters (#2599) 2023-07-13 17:37:20 +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
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
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
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
alson 0384e2fd13 Add support for environments (#2223) 2023-06-13 21:07:11 +02:00
Jonathan Leitschuh daf62bd461 Add support for new RepositoryAdvisories API 🎉 (#2483) 2023-06-09 13:42:18 -04: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
Kevin Grandjean f82ad61c37 Fix broken urls in docstrings (#2393) 2023-06-01 10:36:31 +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
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
Andrew Collington 600217f04f Fixes issue #2521 (#2529) 2023-05-12 09:47:15 -07:00
Felipe Peter bab4180fd5 Add allow_update_branch option to Organization (#2465) 2023-05-08 20:16:36 +02:00
Mikhail f. Shiryaev 4198dbfbac Add parameters to Repository.get_workflow_runs (#2408) 2023-05-06 17:00:09 +08:00
Sol Redfern c7e3ae9421 Add unarchiving support (#2391) 2023-02-13 20:43:07 +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
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
xmo-odoo 001970d4a8 Improve signature of Repository.create_repo (#2118)
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
2021-12-20 18:27:19 +11:00
Tanner 8d1397af2f Add support for 'visibility' attribute preview for Repositories (#1872)
Expose the new 'visibility' attribute for repository objects.

Fixes #1446
2021-11-01 21:02:16 +11:00
Steve Kowalik 6452ddfeb4 Add Repository.rename_branch method (#2089)
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
2021-10-24 15:21:31 +11:00
Mark Walker ab36b89aa5 Fixed links to github docs. [#2009] 2021-07-31 02:34:34 +01:00
Steve Kowalik babcbcd04f Update most URLs to docs.github.com (#1896)
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.
2021-03-26 20:43:48 +11:00
Floyd Hightower c27fb91966 Updating links to Github documentation for deploy keys (#1850)
* Updating links to Github documentation for deploy keys

There are a couple of links to http://developer.github.com/v3/repos/keys/ and I believe these should be going to http://developer.github.com/v3/repos/#deploy-keys. I've updated the docstrings in this file appropriately.
2021-03-24 10:17:28 +11:00
Steve Kowalik 696793dea7 Add support for deleting repository secrets (#1868)
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.
2021-03-17 16:02:57 +11:00
Steve Kowalik aa24030471 Switch repository secrets to using f-strings (#1867)
New code written before we switched to f-strings need to get updated to
using them, so do so.
2021-03-08 15:11:38 +11:00
Chris KeatingandLiuyang Wan c90c050ef1 Adding github actions secrets (#1681)
* Fixed pre-commit issues

* Fixed mypy linting error

* Fix flake8 error

* Update PublicKey.py

* Update PublicKey.py

* Update setup.py

* Update setup.py

* Update requirements.txt

Co-authored-by: Liuyang Wan <tsfdye@gmail.com>

Co-authored-by: Liuyang Wan <tsfdye@gmail.com>
2021-03-07 05:40:52 +08:00
Steve Kowalik 290b62726f Switch all string addition to using f-strings (#1774)
Now that we no longer support Python 3.5, stop using string addition
everywhere it makes sense, and move to the best feature 3.6+ gives us,
f-strings!
2021-03-03 14:50:57 +11:00
Steve Kowalik e113e37de1 Add pyupgrade to pre-commit configuration (#1783)
To help us switch to f-strings and other 3.6+ changes, add pyupgrade to
our pre-commit configuration to keep the codebase clean.
2020-12-15 14:07:33 +11:00
Dhruv ManilawalaandRaju Subramanian 6d501b286e Add support for Check Suites (#1764)
* 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>
2020-11-30 16:03:07 +11:00
Pascal Hofmann 197e065372 Add missing preview features of Deployment and Deployment Statuses API (#1674)
* 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
2020-11-30 15:47:54 +11:00
Dhruv Manilawala c77c06760e Add Support for Check Runs (#1727)
* 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:
2020-11-19 14:29:04 +11:00
Victor Zeng 24251f4b0f Added support for the Self-Hosted actions runners API (#1684)
* Added data model for Self-Hosted Actions Runner

* Added function for getting self-hosted runners
2020-10-28 15:53:33 +11:00
Victor Zeng c23564ddbd Added support for Repository.get_workflow_runs parameters (#1682)
* Added support for `Repository.get_workflow_runs` parameters

* Added anchor tag to docstring link

* Tests
2020-10-28 13:37:59 +11:00
Steve Kowalik 07e29fe014 Format with new black (#1679)
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.
2020-09-02 14:59:09 +10:00
Steve Kowalik 4fb1d23f4d Add support for Workflow Runs (#1583)
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.
2020-06-26 20:47:42 +10:00
Steve Kowalik 3668f866e3 More precise typing for MainClass.get_user() (#1575)
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
2020-06-24 16:21:18 +10:00
Mark Bromell f0f6ec83dd Small documentation correction in Repository.py (#1565)
Class `github.Clone.Clone` doesn't exist and should reference `github.Clones.Clones` instead.
2020-06-20 12:41:25 +10:00
Dominic Davis-Foster ce400bc770 Fixed formatting of docstrings for Repository.create_git_tag_and_release() and StatsPunchCard. (#1520) 2020-05-18 18:04:40 +10:00
Steve Kowalik 53d58d2b07 Remove Repository.topics (#1505)
The topics attribute has been replaced by Repository.get_topics(). To
reduce user confusion, delete the attribute.

Fixes #1504
2020-05-15 10:49:15 +10:00
Steve Kowalik 8727003fc8 Correct Repository.get_workflows() (#1518)
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.
2020-05-14 16:45:01 +10:00
Max Wittig f7cc534d50 docs(repository): correct releases link (#1514) 2020-05-11 08:15:06 +08:00
Steve Kowalik a1ed7c0e2d Add support for Workflows (#1496)
To start supporting GitHub Actions, add the first part of that,
Workflow, which encapsulates a workflow over the API, along with
two methods on Repository to query them.
2020-05-05 15:49:45 +10:00
Steve Kowalik 84bb69abff Drop use of shadow-cat for draft PRs (#1469) 2020-04-26 10:05:20 +08:00