github-repository-provider 7.27.1 → 7.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -0
- package/package.json +4 -4
- package/src/github-repository.mjs +9 -9
package/README.md
CHANGED
|
@@ -68,6 +68,7 @@ console.log(entry.name);
|
|
|
68
68
|
* [open](#open)
|
|
69
69
|
* [Parameters](#parameters-10)
|
|
70
70
|
* [GithubRepository](#githubrepository)
|
|
71
|
+
* [defaultBranchName](#defaultbranchname)
|
|
71
72
|
* [commits](#commits)
|
|
72
73
|
* [Parameters](#parameters-11)
|
|
73
74
|
* [initializeBranches](#initializebranches)
|
|
@@ -75,6 +76,7 @@ console.log(entry.name);
|
|
|
75
76
|
* [urls](#urls)
|
|
76
77
|
* [issuesURL](#issuesurl)
|
|
77
78
|
* [homePageURL](#homepageurl)
|
|
79
|
+
* [api](#api)
|
|
78
80
|
* [update](#update-1)
|
|
79
81
|
* [refId](#refid)
|
|
80
82
|
* [Parameters](#parameters-12)
|
|
@@ -280,6 +282,10 @@ Returns **[Set](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Glob
|
|
|
280
282
|
|
|
281
283
|
Repository on GitHub.
|
|
282
284
|
|
|
285
|
+
### defaultBranchName
|
|
286
|
+
|
|
287
|
+
Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** "main"
|
|
288
|
+
|
|
283
289
|
### commits
|
|
284
290
|
|
|
285
291
|
<https://docs.github.com/en/rest/reference/commits#list-commits>
|
|
@@ -314,6 +320,12 @@ Deliver the url of the repositories home page.
|
|
|
314
320
|
|
|
315
321
|
Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**
|
|
316
322
|
|
|
323
|
+
### api
|
|
324
|
+
|
|
325
|
+
API endpoint for ourselfs.
|
|
326
|
+
|
|
327
|
+
Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**
|
|
328
|
+
|
|
317
329
|
### update
|
|
318
330
|
|
|
319
331
|
<https://developer.github.com/v3/repos/#update-a-repository>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "github-repository-provider",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.29.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -32,17 +32,17 @@
|
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"content-entry": "^5.0.1",
|
|
34
34
|
"fetch-link-util": "^1.0.8",
|
|
35
|
-
"fetch-rate-limit-util": "^
|
|
35
|
+
"fetch-rate-limit-util": "^3.0.2",
|
|
36
36
|
"matching-iterator": "^2.0.4",
|
|
37
37
|
"node-fetch": "^3.2.4",
|
|
38
38
|
"one-time-execution-method": "^3.0.1",
|
|
39
|
-
"repository-provider": "^
|
|
39
|
+
"repository-provider": "^30.3.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"ava": "^4.2.0",
|
|
43
43
|
"c8": "^7.11.3",
|
|
44
44
|
"documentation": "^13.2.5",
|
|
45
|
-
"repository-provider-test-support": "^2.1.
|
|
45
|
+
"repository-provider-test-support": "^2.1.22",
|
|
46
46
|
"semantic-release": "^19.0.2"
|
|
47
47
|
},
|
|
48
48
|
"engines": {
|
|
@@ -39,6 +39,9 @@ export class GithubRepository extends Repository {
|
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
+
/**
|
|
43
|
+
* @return {string} "main"
|
|
44
|
+
*/
|
|
42
45
|
get defaultBranchName() {
|
|
43
46
|
return "main";
|
|
44
47
|
}
|
|
@@ -117,11 +120,10 @@ export class GithubRepository extends Repository {
|
|
|
117
120
|
* API endpoint for ourselfs.
|
|
118
121
|
* @return {string}
|
|
119
122
|
*/
|
|
120
|
-
get api()
|
|
121
|
-
|
|
122
|
-
return `repos/${this.slug}`;
|
|
123
|
+
get api() {
|
|
124
|
+
return `repos/${this.slug}`;
|
|
123
125
|
}
|
|
124
|
-
|
|
126
|
+
|
|
125
127
|
/**
|
|
126
128
|
* {@link https://developer.github.com/v3/repos/#update-a-repository}
|
|
127
129
|
*/
|
|
@@ -137,7 +139,6 @@ export class GithubRepository extends Repository {
|
|
|
137
139
|
});
|
|
138
140
|
}
|
|
139
141
|
|
|
140
|
-
|
|
141
142
|
#ref;
|
|
142
143
|
|
|
143
144
|
/**
|
|
@@ -177,7 +178,7 @@ export class GithubRepository extends Repository {
|
|
|
177
178
|
|
|
178
179
|
async createBranch(name, from, options) {
|
|
179
180
|
await this.initializeBranches();
|
|
180
|
-
|
|
181
|
+
|
|
181
182
|
const branch = await this.branch(name);
|
|
182
183
|
if (branch) {
|
|
183
184
|
return branch;
|
|
@@ -189,8 +190,7 @@ export class GithubRepository extends Repository {
|
|
|
189
190
|
sha = await this.refId(
|
|
190
191
|
`heads/${from ? from.name : this.defaultBranchName}`
|
|
191
192
|
);
|
|
192
|
-
}
|
|
193
|
-
else {
|
|
193
|
+
} else {
|
|
194
194
|
/*
|
|
195
195
|
* https://stackoverflow.com/questions/9765453/is-gits-semi-secret-empty-tree-object-reliable-and-why-is-there-not-a-symbolic/9766506#9766506
|
|
196
196
|
* sha1:4b825dc642cb6eb9a060e54bf8d69288fbee4904
|
|
@@ -262,7 +262,7 @@ export class GithubRepository extends Repository {
|
|
|
262
262
|
const { response, json } = await this.provider.fetchJSON(next);
|
|
263
263
|
|
|
264
264
|
for (const h of json) {
|
|
265
|
-
|
|
265
|
+
this.addHook(h.name, {
|
|
266
266
|
...h,
|
|
267
267
|
...h.config
|
|
268
268
|
});
|