Constructor
new GitHubWrapper(token)
The wrapper class that provides an API interface for all GitHub related operations.
- Source:
The wrapper class that provides an API interface for all GitHub related operations.
Parameters:
| Name | Type | Description |
|---|---|---|
token |
string |
The GitHub Personal Access Token to be used to access the repositories |
Methods
(async) _fetchData(url) → {object}
Given a GitHub REST API endpoint, call it and give back the information returned.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
url |
string |
the url giving the information we seek |
Returns:
Hopefully, the required information from GitHub.
- Type
- object
(async) createRelease(releaseData) → {null}
Given the required data, creates a release on Github.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
releaseData |
object |
The data required for creating a release on GitHub |
Returns:
Nothing.
- Type
- null
(async) fetchCommitAuthorInformation(repository, commitLog) → {object}
Given a GitHub repository, returns information about the commit author pointed to by the commitLog object.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
repository |
object |
the GitHub repository to query for the release |
commitLog |
string |
the git commit object for which the author information needs to be fetched |
Returns:
The required information about the commit author from GitHub.
- Type
- object
(async) fetchCommitInformation(repository, commitLog) → {object}
Given a GitHub repository, returns information about the commit pointed to by the commitLog object.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
repository |
object |
the GitHub repository to query for the release |
commitLog |
string |
the git commit object for which commit information needs to be fetched |
Returns:
The required information about the commit from GitHub.
- Type
- object
(async) fetchReleaseInformation(repository, releaseName) → {object}
Given a GitHub repository, returns information about the release - either the latest, or the one matching the specified release name.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
repository |
object |
the GitHub repository to query for the release |
releaseName |
string |
the name of the release |
Returns:
The required information about the release from GitHub.
- Type
- object
getCommitLink(repository, commitLog) → {object}
Given a GitHub repository, and a commit, returns the URL to access the commit directly.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
repository |
object |
the GitHub repository to query for the release |
commitLog |
object |
the commit information |
Returns:
The URL to access the commit on GitHub.
- Type
- object