You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A small Java library for talking to GitHub/GitHub Enterprise and interacting with projects.
@@ -22,11 +21,13 @@ You can find this library in [maven central repository](https://mvnrepository.co
22
21
Include the latest version of github-client into your project:
23
22
24
23
In Maven:
24
+
25
25
```xml
26
+
26
27
<dependency>
27
-
<groupId>com.spotify</groupId>
28
-
<artifactId>github-client</artifactId>
29
-
<version>version</version>
28
+
<groupId>com.spotify</groupId>
29
+
<artifactId>github-client</artifactId>
30
+
<version>version</version>
30
31
</dependency>
31
32
```
32
33
@@ -44,10 +45,10 @@ To authenticate as a GitHub App, you must provide a private key and the App ID,
44
45
45
46
```java
46
47
finalGitHubClient githubClient =
47
-
GitHubClient.create(
48
-
URI.create("https://api.github.com/"),
49
-
newFile("/path-to-the/private-key.pem"),
50
-
APP_ID);
48
+
GitHubClient.create(
49
+
URI.create("https://api.github.com/"),
50
+
newFile("/path-to-the/private-key.pem"),
51
+
APP_ID);
51
52
```
52
53
53
54
Then, you can scope the client for a specific Installation ID, to do the operations at the installation level.
@@ -60,12 +61,16 @@ final GitHubClient scopedClient = GitHubClient.scopeForInstallationId(githubClie
60
61
61
62
It is also possible to provide the installation to the root client.
62
63
63
-
Refer to [GitHub App Authentication Guide](https://developer.github.com/apps/building-github-apps/authenticating-with-github-apps/) for more information.
64
+
Refer
65
+
to [GitHub App Authentication Guide](https://developer.github.com/apps/building-github-apps/authenticating-with-github-apps/)
66
+
for more information.
64
67
65
68
## Usage
66
69
67
-
This library attempts to mirror the structure of GitHub API endpoints. As an example, to get details of a Commit, there is
68
-
the `GET /repos/:owner/:repo/commits` API call, under the `repos` API. Therefore, the `getCommit` method lives in the RepositoryClient.
70
+
This library attempts to mirror the structure of GitHub API endpoints. As an example, to get details of a Commit, there
71
+
is
72
+
the `GET /repos/:owner/:repo/commits` API call, under the `repos` API. Therefore, the `getCommit` method lives in the
0 commit comments