api
GithubPullRequest
¶
GithubShaStatus
dataclass
¶
commit_status(token, owner, repo, sha_info)
¶
Set a status for a sha.
The valid states are::
- pending
- success
- failure
- error
Parameters:
Name | Type | Description | Default |
---|---|---|---|
token |
str
|
A github PAT. |
required |
owner |
str
|
The owner of the repo. |
required |
repo |
str
|
The name of the repo. |
required |
sha_info |
GithubShaStatus
|
An instance of a |
required |
Returns:
Type | Description |
---|---|
Res[Any]
|
The response from Github after setting a commit status. |
Source code in m/github/api.py
create_pr(token, owner, repo, pr_info)
¶
Send a payload to create a pull request in github.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
token |
str
|
A github PAT. |
required |
owner |
str
|
The owner of the repo. |
required |
repo |
str
|
The name of the repo. |
required |
pr_info |
GithubPullRequest
|
The pull request information. |
required |
Returns:
Type | Description |
---|---|
Res[Any]
|
The Github response if successful. |
Source code in m/github/api.py
create_release(token, owner, repo, version, branch=None)
¶
Send a payload to create a release in github.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
token |
str
|
A github PAT. |
required |
owner |
str
|
The owner of the repo. |
required |
repo |
str
|
The name of the repo. |
required |
version |
str
|
The version that marks the release. |
required |
branch |
str | None
|
Optional branch to tag, defaults to the default branch. |
None
|
Returns:
Type | Description |
---|---|
Res[Any]
|
The Github response after a release is created. |
Source code in m/github/api.py
merge_pr(token, owner, repo, pr_number, commit_title)
¶
Send a payload to merge a pull request in github.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
token |
str
|
A github PAT. |
required |
owner |
str
|
The owner of the repo. |
required |
repo |
str
|
The name of the repo. |
required |
pr_number |
int
|
The number of the pull request. |
required |
commit_title |
str | None
|
An optional commit title to use when merging. |
required |
Returns:
Type | Description |
---|---|
Res[Any]
|
The payload provided by Github if successful. |