Commit Graph
247 Commits
Author SHA1 Message Date
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
Florent Clarret d3bc6a5cd2 List matching references (#1471) 2020-04-26 10:03:36 +08:00
Chris de Graaf edcbdfdaf9 Add create_repository_dispatch (#1449) 2020-04-26 09:59:34 +08:00
ton-katsu 3ab97d6145 Add some attributes. (#1468)
* Add some attributes to Repository and Organization

* Format.

* small fix

* Add some test.
2020-04-21 11:49:32 +10:00
Alice GIRARDandLiuyang Wan 91433fe925 Type stubs for mypy (#1231)
* First attempt at stubs

* fix AuthenticatedUser.piy

* fix PullRequest.piy

* fix Authorization.piy

* fix Branch.piy

* fix Clones.piy

* fix Commit.piy

* fix CommitCombinedStatus.piy

* fix CommitComment.piy

* fix CommitStatus.piy

* fix ContentFile.piy

* fix Download.piy

* fix Event.piy

* fix File.piy

* fix Gist.piy

* fix GistComment.piy

* fix GistFile.piy

* fix GitAuthor.piy

* fix GitBlob.piy

* fix GitCommit.piy

* fix GitRef.piy

* fix GitRelease.piy

* renamed stubs into pyi files

* fix Notification

* fix Repository

* fix GitReleaseAsset

* fix GitTag

* fix GitTree

* fix GitTreeElement

* fix GithubException

* fix GithubObject

* fix GitignoreTemplate

* fix HookDescription

* fix HookResponse

* fix InputGitAuthor

* fix Installation

* fix InstallationAuthorization

* fix Invitation

* fix Issue

* fix IssueComment

* Fix random issues found while testing

* fix IssuePullRequest

* fix Label

* fix License

* fix Migration

* fix Milestone

* fix NamedUser

* fix NotificationSubject

* fix Organization

* fix PaginatedList

* fix Path

* fix Permissions

* fix Plan

* fix Project

* fix ProjectCard

* fix ProjectColumn

* fix PullRequestComment

* fix PullRequestMergeStatus

* fix PullRequestPart

* fix PullRequestReview

* fix Rate

* fix RateLimit

* fix Reaction

* fix Referrer

* fix RepositoryKey

* fix RequiredPullRequestReviews

* fix RequiredStatusChecks

* fix SourceImport

* fix Stargazer

* fix StatsCodeFrequency

* fix StatsCommitActivity

* fix StatsContributor

* fix Tag

* fix Team

* fix Topic

* fix UserKey

* fix MainClass

* fix Requester

* added stubs for View

* added stubs for Membership

* various syntax errors

* silence mypy noise

* keeping track of recent changes

* black + isort

Co-authored-by: Liuyang Wan <lwan@zendesk.com>
2020-03-22 19:33:23 +08:00
Steve Kowalik bfeacded4e Docstring for Repository.create_git_tag_and_release (#1425)
The function create_git_tag_and_release had no docstring, so it didn't
appear anywhere in our docs. Add a short one linking to the two methods
it calls.

Fixes #1402
2020-03-09 10:56:31 +11:00
Steve Kowalik 3d93ee1ce5 Add Deployments API (#1424)
Add a new class, Deployment to describe a deployment performed utilising
GitHub. Add three methods onto Repository to list them and create them.

Fixes #1117
2020-03-08 16:27:59 +11:00
Anuj Bansal bd0211eb73 Add draft flag parameter, update tests 2020-03-07 11:42:41 +05:30
Glenn McDonald 9564cd4de7 Add repo edit support for delete_branch_on_merge (#1381)
* Add repo edit support for delete_branch_on_merge

* Assert delete_branch_on_merge
2020-02-11 12:24:33 +11:00
Tim Gates ad040bafaf Fix mistake in Repository.create_fork() (#1383)
I modified #1306 to use the NotSet parameter after
it was pointed out this was more appropriate however
I did not also update the conditional.
2020-02-09 20:38:50 +11:00
Huw Jones 4ae1a1e523 Search repo issues by string label (#1379)
* Allow use of strings for labels in Repository.get_issues

* Fix unittests

* Update docstring

* Removed brackets from "list of..."
2020-02-09 16:41:33 +11:00
Steve Kowalik ead565adf8 Correct Repository.create_git_tag_and_release() (#1362)
Repository.create_git_tag_and_release() is a convience function that
creates a git tag and then a release. It was not passing the SHA1 of the
commit to the release function, resulting in incorrect releases.

Fixes #1336
2020-01-25 16:34:48 +11:00
Steve Kowalik 0e09983dca Repository.create_project() body is optional (#1359)
The POST parameters passed to the create_project API call did not
consider the body optional, and always included it. Fix up a formatting
error in the docstring for good measure.

Fixes #1357
2020-01-19 14:31:58 +10:00
Steve Kowalik b7894ea00c Drop Python 2 support (#1329)
With the Python 2 deadline gone, it's time to move with the times and
switch to Python 3 only.
2020-01-06 18:01:38 +11:00
Wan Liuyang 540a085001 Fix isort - add known first and third party 2019-12-11 00:54:59 +08:00
Wan Liuyang 88549a56df black 2019-12-10 23:13:34 +08:00
Wan Liuyang 6ceb9e9a15 Apply black to whole codebase (#1303) 2019-12-10 17:14:33 +08:00
Kevin LaFlamme f8e33620f4 Fix class used returning pull request comments (#1307)
Repository.get_pull_request_comments() was returning the wrong type.
2019-11-30 12:14:50 +11:00
Tim Gates 2ad51f352e Support for create_fork (#1306)
* Support for create_fork

http://developer.github.com/v3/repos/forks

* Add test case for create_fork

* Add param doc and fix extra line

* Specify the organization to increase line coverage

* Update test data

* Add type assert for organization param
2019-11-28 21:44:00 +11:00