File tree 6 files changed +33
-18
lines changed
6 files changed +33
-18
lines changed Original file line number Diff line number Diff line change @@ -45,18 +45,34 @@ and then use it:
45
45
``` dart
46
46
import 'package:github/github.dart';
47
47
48
- void main() async {
48
+ Future< void> main() async {
49
49
/* Create a GitHub Client, with anonymous authentication by default */
50
50
var github = GitHub();
51
51
52
- /* or Create a GitHub Client and have it try to find your token or credentials automatically */
53
- var github = GitHub(auth: findAuthenticationFromEnvironment());
52
+ /* or Create a GitHub Client and have it try to find your token or credentials automatically
53
+ In Flutter and in server environments this will search environment variables in this order
54
+ GITHUB_ADMIN_TOKEN
55
+ GITHUB_DART_TOKEN
56
+ GITHUB_API_TOKEN
57
+ GITHUB_TOKEN
58
+ HOMEBREW_GITHUB_API_TOKEN
59
+ MACHINE_GITHUB_API_TOKEN
60
+ and then GITHUB_USERNAME and GITHUB_PASSWORD
61
+
62
+ In a browser it will search keys in the same order first through the query string parameters
63
+ and then in window sessionStorage
64
+ */
65
+ var github = GitHub(auth: findAuthenticationFromEnvironment());
54
66
55
67
/* or Create a GitHub Client using an auth token */
56
- var github = GitHub(auth: new Authentication.withToken("YourTokenHere"));
68
+ var github = GitHub(auth: new Authentication.withToken("YourTokenHere"));
69
+
70
+ /* or Create a GitHub Client using a username and password */
71
+ var github = GitHub(auth: new Authentication.basic('username', 'password'));
57
72
58
73
Repository repo = await github.repositories.getRepository(new RepositorySlug("user_or_org", "repo_name"));
59
74
/* Do Something with repo */
75
+
60
76
}
61
77
```
62
78
Original file line number Diff line number Diff line change @@ -14,7 +14,8 @@ Future<void> main() async {
14
14
15
15
void loadReleases () {
16
16
github.repositories
17
- .listReleases (RepositorySlug ('twbs' , 'bootstrap' ))
17
+ .listReleases (RepositorySlug ('Workiva' , 'wdesk' ))
18
+ .take (10 )
18
19
.toList ()
19
20
.then ((releases) {
20
21
for (final release in releases) {
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ part 'repos_releases.g.dart';
11
11
class Release {
12
12
Release ({
13
13
this .id,
14
+ this .url,
14
15
this .htmlUrl,
15
16
this .tarballUrl,
16
17
this .uploadUrl,
@@ -28,6 +29,9 @@ class Release {
28
29
this .assets,
29
30
});
30
31
32
+ /// Url to this Release
33
+ String url;
34
+
31
35
/// Url to this Release
32
36
String htmlUrl;
33
37
Original file line number Diff line number Diff line change @@ -935,14 +935,6 @@ class RepositoriesService extends Service {
935
935
);
936
936
}
937
937
938
- /// Fetches a single release by the release ID.
939
- ///
940
- /// API docs: https://developer.github.com/v3/repos/releases/#get-a-single-release
941
- @Deprecated (
942
- 'Use getReleaseById or for getting a release using a tag name, use getReleaseByTagName' )
943
- Future <Release > getRelease (RepositorySlug slug, int id) =>
944
- getReleaseById (slug, id);
945
-
946
938
/// Fetches a single release by the release ID.
947
939
///
948
940
/// API docs: https://developer.github.com/v3/repos/releases/#get-a-single-release
Original file line number Diff line number Diff line change 1
1
# Integration Tests
2
2
3
- The integration tests will run against the live GitHub API. These tests will
3
+ The integration tests will run against the live GitHub API. These tests will
4
4
verify that the library is properly coded against the actual behavior of the
5
5
GitHub API.
6
6
7
7
To run these tests a GitHub repository and OAuth token will need to be defined
8
- in the ` config/config.dart ` file.
8
+ in the ` config/config.dart ` file.
9
9
10
- ** Warning:** The test will delete and recreate the specified repository to
11
- start with a clean repo. It is highly recommended that a dedicated test account
12
- is used!
10
+ ** Warning:** The test will delete and recreate the specified repository to
11
+ start with a clean repo. It is highly recommended that a dedicated test account
12
+ is used!
You can’t perform that action at this time.
0 commit comments