github-repository-provider 7.26.23 → 7.26.26
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 +4 -4
- package/package.json +3 -3
- package/src/github-repository.mjs +6 -4
package/README.md
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
[](https://opensource.org/licenses/BSD-3-Clause)
|
|
3
3
|
[](https://bundlephobia.com/result?p=github-repository-provider)
|
|
4
4
|
[](https://npmjs.org/package/github-repository-provider)
|
|
5
|
-
[](https://github.com/github-repository-provider/github-repository-provider/issues)
|
|
6
|
+
[](https://actions-badge.atrox.dev/github-repository-provider/github-repository-provider/goto)
|
|
7
7
|
[](https://github.com/prettier/prettier)
|
|
8
8
|
[](http://commitizen.github.io/cz-cli/)
|
|
9
|
-
[](https://snyk.io/test/github/github-repository-provider/github-repository-provider)
|
|
10
|
+
[](https://coveralls.io/github/github-repository-provider/github-repository-provider)
|
|
11
11
|
|
|
12
12
|
# github-repository-provider
|
|
13
13
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "github-repository-provider",
|
|
3
|
-
"version": "7.26.
|
|
3
|
+
"version": "7.26.26",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -32,11 +32,11 @@
|
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"content-entry": "^5.0.0",
|
|
34
34
|
"fetch-link-util": "^1.0.8",
|
|
35
|
-
"fetch-rate-limit-util": "^2.10.
|
|
35
|
+
"fetch-rate-limit-util": "^2.10.2",
|
|
36
36
|
"matching-iterator": "^2.0.4",
|
|
37
37
|
"node-fetch": "^3.2.4",
|
|
38
38
|
"one-time-execution-method": "^2.0.13",
|
|
39
|
-
"repository-provider": "^28.3.
|
|
39
|
+
"repository-provider": "^28.3.11"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"ava": "^4.2.0",
|
|
@@ -3,7 +3,7 @@ import { Repository } from "repository-provider";
|
|
|
3
3
|
import { getHeaderLink } from "fetch-link-util";
|
|
4
4
|
import { defaultStateActions, errorHandler } from "fetch-rate-limit-util";
|
|
5
5
|
|
|
6
|
-
const
|
|
6
|
+
const conflictErrorActions = {
|
|
7
7
|
...defaultStateActions,
|
|
8
8
|
409: errorHandler
|
|
9
9
|
};
|
|
@@ -146,13 +146,11 @@ export class GithubRepository extends Repository {
|
|
|
146
146
|
this._ref = new Map();
|
|
147
147
|
}
|
|
148
148
|
|
|
149
|
-
// TODO: 409 -> none repeatable
|
|
150
149
|
const { response, json } = await this.provider.fetchJSON(
|
|
151
150
|
`repos/${this.slug}/git/ref/${ref}`,
|
|
152
151
|
undefined,
|
|
153
|
-
|
|
152
|
+
conflictErrorActions
|
|
154
153
|
);
|
|
155
|
-
|
|
156
154
|
// TODO why does this happen ?
|
|
157
155
|
if (!response.ok || !json.object.sha) {
|
|
158
156
|
throw new Error(`No refId for '${this.fullName}' '${ref}'`);
|
|
@@ -166,6 +164,8 @@ export class GithubRepository extends Repository {
|
|
|
166
164
|
}
|
|
167
165
|
|
|
168
166
|
async createBranch(name, from, options) {
|
|
167
|
+
await this.initializeBranches();
|
|
168
|
+
|
|
169
169
|
const branch = this._branches.get(name);
|
|
170
170
|
if (branch) {
|
|
171
171
|
return branch;
|
|
@@ -206,6 +206,8 @@ export class GithubRepository extends Repository {
|
|
|
206
206
|
if (res.ok) {
|
|
207
207
|
return this.addBranch(name, options);
|
|
208
208
|
}
|
|
209
|
+
|
|
210
|
+
throw new Error(`Unable to create branch '${name}'`);
|
|
209
211
|
}
|
|
210
212
|
|
|
211
213
|
async deleteBranch(name) {
|