npm-update-package 0.26.0 → 0.26.1
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
CHANGED
|
@@ -159,9 +159,9 @@ jobs:
|
|
|
159
159
|
npx npm-update-package --github-token $GITHUB_TOKEN
|
|
160
160
|
env:
|
|
161
161
|
# TODO: Replace with your GitHub App's email
|
|
162
|
-
GIT_USER_EMAIL: 97396142+npm-update-package
|
|
162
|
+
GIT_USER_EMAIL: 97396142+npm-update-package[bot]@users.noreply.github.com
|
|
163
163
|
# TODO: Replace with your GitHub App's user name
|
|
164
|
-
GIT_USER_NAME: npm-update-package
|
|
164
|
+
GIT_USER_NAME: npm-update-package[bot]
|
|
165
165
|
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
|
|
166
166
|
```
|
|
167
167
|
|
|
@@ -215,9 +215,9 @@ jobs:
|
|
|
215
215
|
npx npm-update-package --github-token $GITHUB_TOKEN --package-manager yarn
|
|
216
216
|
env:
|
|
217
217
|
# TODO: Replace with your GitHub App's email
|
|
218
|
-
GIT_USER_EMAIL: 97396142+npm-update-package
|
|
218
|
+
GIT_USER_EMAIL: 97396142+npm-update-package[bot]@users.noreply.github.com
|
|
219
219
|
# TODO: Replace with your GitHub App's user name
|
|
220
|
-
GIT_USER_NAME: npm-update-package
|
|
220
|
+
GIT_USER_NAME: npm-update-package[bot]
|
|
221
221
|
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
|
|
222
222
|
```
|
|
223
223
|
|
package/dist/app.js
CHANGED
package/dist/github/GitHub.js
CHANGED
|
@@ -6,18 +6,32 @@ class GitHub {
|
|
|
6
6
|
constructor(octokit) {
|
|
7
7
|
this.octokit = octokit;
|
|
8
8
|
}
|
|
9
|
-
async addLabels(
|
|
10
|
-
const { data } = await this.octokit.issues.addLabels(
|
|
9
|
+
async addLabels({ owner, repo, issueNumber, labels }) {
|
|
10
|
+
const { data } = await this.octokit.issues.addLabels({
|
|
11
|
+
owner,
|
|
12
|
+
repo,
|
|
13
|
+
issue_number: issueNumber,
|
|
14
|
+
labels
|
|
15
|
+
});
|
|
11
16
|
return data;
|
|
12
17
|
}
|
|
13
|
-
async closePullRequest(
|
|
18
|
+
async closePullRequest({ owner, repo, pullNumber }) {
|
|
14
19
|
await this.octokit.pulls.update({
|
|
15
|
-
|
|
20
|
+
owner,
|
|
21
|
+
repo,
|
|
22
|
+
pull_number: pullNumber,
|
|
16
23
|
state: 'closed'
|
|
17
24
|
});
|
|
18
25
|
}
|
|
19
|
-
async createPullRequest(
|
|
20
|
-
const { data } = await this.octokit.pulls.create(
|
|
26
|
+
async createPullRequest({ owner, repo, baseBranch, headBranch, title, body }) {
|
|
27
|
+
const { data } = await this.octokit.pulls.create({
|
|
28
|
+
owner,
|
|
29
|
+
repo,
|
|
30
|
+
base: baseBranch,
|
|
31
|
+
head: headBranch,
|
|
32
|
+
title,
|
|
33
|
+
body
|
|
34
|
+
});
|
|
21
35
|
return data;
|
|
22
36
|
}
|
|
23
37
|
async deleteBranch({ owner, repo, branch }) {
|
|
@@ -28,23 +42,28 @@ class GitHub {
|
|
|
28
42
|
});
|
|
29
43
|
}
|
|
30
44
|
// TODO: fetch all branches with page option
|
|
31
|
-
async fetchBranches(
|
|
45
|
+
async fetchBranches({ owner, repo }) {
|
|
32
46
|
const { data } = await this.octokit.repos.listBranches({
|
|
33
|
-
|
|
47
|
+
owner,
|
|
48
|
+
repo,
|
|
34
49
|
per_page: 100
|
|
35
50
|
});
|
|
36
51
|
return data;
|
|
37
52
|
}
|
|
38
53
|
// TODO: fetch all pull requests with page option
|
|
39
|
-
async fetchPullRequests(
|
|
54
|
+
async fetchPullRequests({ owner, repo }) {
|
|
40
55
|
const { data } = await this.octokit.pulls.list({
|
|
41
|
-
|
|
56
|
+
owner,
|
|
57
|
+
repo,
|
|
42
58
|
per_page: 100
|
|
43
59
|
});
|
|
44
60
|
return data;
|
|
45
61
|
}
|
|
46
|
-
async fetchRepository(
|
|
47
|
-
const { data } = await this.octokit.repos.get(
|
|
62
|
+
async fetchRepository({ owner, repo }) {
|
|
63
|
+
const { data } = await this.octokit.repos.get({
|
|
64
|
+
owner,
|
|
65
|
+
repo
|
|
66
|
+
});
|
|
48
67
|
return data;
|
|
49
68
|
}
|
|
50
69
|
async requestReviewers({ owner, repo, pullNumber, reviewers }) {
|
|
@@ -9,7 +9,7 @@ class PullRequestCloser {
|
|
|
9
9
|
await this.github.closePullRequest({
|
|
10
10
|
owner: pullRequest.base.repo.owner.login,
|
|
11
11
|
repo: pullRequest.base.repo.name,
|
|
12
|
-
|
|
12
|
+
pullNumber: pullRequest.number
|
|
13
13
|
});
|
|
14
14
|
await this.github.deleteBranch({
|
|
15
15
|
owner: pullRequest.base.repo.owner.login,
|
|
@@ -19,8 +19,8 @@ class PullRequestCreator {
|
|
|
19
19
|
const pullRequest = await this.github.createPullRequest({
|
|
20
20
|
owner: this.gitRepo.owner,
|
|
21
21
|
repo: this.gitRepo.name,
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
baseBranch: this.githubRepo.default_branch,
|
|
23
|
+
headBranch: branchName,
|
|
24
24
|
title,
|
|
25
25
|
body
|
|
26
26
|
});
|
|
@@ -28,7 +28,7 @@ class PullRequestCreator {
|
|
|
28
28
|
await this.github.addLabels({
|
|
29
29
|
owner: this.gitRepo.owner,
|
|
30
30
|
repo: this.gitRepo.name,
|
|
31
|
-
|
|
31
|
+
issueNumber: pullRequest.number,
|
|
32
32
|
labels: ['npm-update-package']
|
|
33
33
|
});
|
|
34
34
|
if (this.reviewers !== undefined) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "npm-update-package",
|
|
3
|
-
"version": "0.26.
|
|
3
|
+
"version": "0.26.1",
|
|
4
4
|
"description": "CLI tool for creating pull requests to update npm packages",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "tsc --project tsconfig.build.json",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"eslint-plugin-tsdoc": "0.2.14",
|
|
48
48
|
"husky": "7.0.4",
|
|
49
49
|
"jest": "27.4.7",
|
|
50
|
-
"lint-staged": "12.2.
|
|
50
|
+
"lint-staged": "12.2.1",
|
|
51
51
|
"npm-run-all": "4.1.5",
|
|
52
52
|
"rimraf": "3.0.2",
|
|
53
53
|
"ts-jest": "27.1.3",
|