public class Github extends TaskclusterRequestHandler
The github service, typically available at github.taskcluster.net
, is responsible for publishing pulse messages in response to GitHub events.
This document describes the API end-point for consuming GitHub web hooks, as well as some useful consumer APIs.
When Github forbids an action, this service returns an HTTP 403 with code ForbiddenByGithub.
Modifier and Type | Field and Description |
---|---|
protected static String |
defaultBaseURL |
Constructor and Description |
---|
Github() |
Github(Credentials credentials) |
Github(Credentials credentials,
String baseURL) |
Github(String baseURL) |
Github(String clientId,
String accessToken) |
Github(String clientId,
String accessToken,
String certificate) |
Modifier and Type | Method and Description |
---|---|
CallSummary<EmptyPayload,EmptyPayload> |
badge(String owner,
String repo,
String branch)
Checks the status of the latest build of a given branch and returns corresponding badge svg.
|
CallSummary<EmptyPayload,BuildsResponse> |
builds()
A paginated list of builds that have been run in Taskcluster.
|
CallSummary<CreateCommentRequest,EmptyPayload> |
createComment(String owner,
String repo,
String number,
CreateCommentRequest payload)
For a given Issue or Pull Request of a repository, this will write a new message.
|
CallSummary<CreateStatusRequest,EmptyPayload> |
createStatus(String owner,
String repo,
String sha,
CreateStatusRequest payload)
For a given changeset (SHA) of a repository, this will attach a “commit status” on github.
|
CallSummary<EmptyPayload,EmptyPayload> |
githubWebHookConsumer()
Capture a GitHub event and publish it via pulse, if it’s a push, release or pull request.
|
CallSummary<EmptyPayload,EmptyPayload> |
latest(String owner,
String repo,
String branch)
For a given branch of a repository, this will always point to a status page for the most recent task triggered by that branch.
|
CallSummary<EmptyPayload,EmptyPayload> |
ping()
Respond without doing anything.
|
CallSummary<EmptyPayload,RepositoryResponse> |
repository(String owner,
String repo)
Returns any repository metadata that is useful within Taskcluster related services.
|
apiCall, setBaseURL, uriEncode
protected static final String defaultBaseURL
public Github(Credentials credentials)
public Github(Credentials credentials, String baseURL)
public Github(String baseURL)
public Github()
public CallSummary<EmptyPayload,EmptyPayload> ping() throws APICallFailure
Respond without doing anything. This endpoint is used to check that the service is up.
APICallFailure
public CallSummary<EmptyPayload,EmptyPayload> githubWebHookConsumer() throws APICallFailure
Capture a GitHub event and publish it via pulse, if it’s a push, release or pull request.
APICallFailure
public CallSummary<EmptyPayload,BuildsResponse> builds() throws APICallFailure
A paginated list of builds that have been run in Taskcluster. Can be filtered on various git-specific fields.
APICallFailure
public CallSummary<EmptyPayload,EmptyPayload> badge(String owner, String repo, String branch) throws APICallFailure
Checks the status of the latest build of a given branch and returns corresponding badge svg.
APICallFailure
public CallSummary<EmptyPayload,RepositoryResponse> repository(String owner, String repo) throws APICallFailure
Returns any repository metadata that is useful within Taskcluster related services.
APICallFailure
public CallSummary<EmptyPayload,EmptyPayload> latest(String owner, String repo, String branch) throws APICallFailure
For a given branch of a repository, this will always point to a status page for the most recent task triggered by that branch.
Note: This is a redirect rather than a direct link.
APICallFailure
public CallSummary<CreateStatusRequest,EmptyPayload> createStatus(String owner, String repo, String sha, CreateStatusRequest payload) throws APICallFailure
For a given changeset (SHA) of a repository, this will attach a “commit status” on github. These statuses are links displayed next to each revision. The status is either OK (green check) or FAILURE (red cross), made of a custom title and link.
Required scopes: github:create-status:
APICallFailure
public CallSummary<CreateCommentRequest,EmptyPayload> createComment(String owner, String repo, String number, CreateCommentRequest payload) throws APICallFailure
For a given Issue or Pull Request of a repository, this will write a new message.
Required scopes: github:create-comment:
Copyright © 2014–2018 Mozilla. All rights reserved.