accept-to-ship-action 0.4.8 → 0.5.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/eslint.config.js +45 -0
- package/lib/getCheckRuns.d.ts +2 -4
- package/lib/getPullRequestReviewRequests.d.ts +2 -0
- package/lib/getPullRequestReviews.d.ts +1 -1
- package/lib/getWorkflowRunJobs.d.ts +5 -2
- package/lib/index.js +2 -2
- package/lib/mergePullRequest.js +1 -1
- package/package.json +26 -18
package/eslint.config.js
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import js from '@eslint/js';
|
|
2
|
+
import { FlatCompat } from '@eslint/eslintrc';
|
|
3
|
+
import path from 'path';
|
|
4
|
+
import { fileURLToPath } from 'url';
|
|
5
|
+
import ts from 'typescript-eslint';
|
|
6
|
+
|
|
7
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
8
|
+
const __dirname = path.dirname(__filename);
|
|
9
|
+
|
|
10
|
+
const compat = new FlatCompat({
|
|
11
|
+
baseDirectory: __dirname,
|
|
12
|
+
resolvePluginsRelativeTo: __dirname,
|
|
13
|
+
recommendedConfig: js.configs.recommended,
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export default ts.config(
|
|
17
|
+
...compat.config({
|
|
18
|
+
env: {
|
|
19
|
+
browser: true,
|
|
20
|
+
es2022: true,
|
|
21
|
+
node: true,
|
|
22
|
+
},
|
|
23
|
+
extends: ['eslint:recommended', 'plugin:prettier/recommended'],
|
|
24
|
+
parser: '@typescript-eslint/parser',
|
|
25
|
+
parserOptions: {
|
|
26
|
+
project: './tsconfig.json',
|
|
27
|
+
ecmaVersion: 'latest',
|
|
28
|
+
sourceType: 'module',
|
|
29
|
+
},
|
|
30
|
+
root: true,
|
|
31
|
+
rules: {},
|
|
32
|
+
ignorePatterns: [
|
|
33
|
+
'node_modules/**/*',
|
|
34
|
+
'lib/**/*',
|
|
35
|
+
'dist/**/*',
|
|
36
|
+
'eslint.config.js',
|
|
37
|
+
],
|
|
38
|
+
overrides: [
|
|
39
|
+
{
|
|
40
|
+
files: ['*.ts'],
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
}),
|
|
44
|
+
...ts.configs.recommendedTypeChecked,
|
|
45
|
+
);
|
package/lib/getCheckRuns.d.ts
CHANGED
|
@@ -57,13 +57,12 @@ export declare function getCheckRuns(owner: string, repo: string, ref: string, o
|
|
|
57
57
|
created_at: string;
|
|
58
58
|
updated_at: string;
|
|
59
59
|
permissions: {
|
|
60
|
+
[key: string]: string | undefined;
|
|
60
61
|
issues?: string | undefined;
|
|
61
62
|
checks?: string | undefined;
|
|
62
63
|
metadata?: string | undefined;
|
|
63
64
|
contents?: string | undefined;
|
|
64
65
|
deployments?: string | undefined;
|
|
65
|
-
} & {
|
|
66
|
-
[key: string]: string;
|
|
67
66
|
};
|
|
68
67
|
events: string[];
|
|
69
68
|
installations_count?: number | undefined;
|
|
@@ -143,13 +142,12 @@ export declare function getCheckRuns(owner: string, repo: string, ref: string, o
|
|
|
143
142
|
created_at: string;
|
|
144
143
|
updated_at: string;
|
|
145
144
|
permissions: {
|
|
145
|
+
[key: string]: string | undefined;
|
|
146
146
|
issues?: string | undefined;
|
|
147
147
|
checks?: string | undefined;
|
|
148
148
|
metadata?: string | undefined;
|
|
149
149
|
contents?: string | undefined;
|
|
150
150
|
deployments?: string | undefined;
|
|
151
|
-
} & {
|
|
152
|
-
[key: string]: string;
|
|
153
151
|
};
|
|
154
152
|
events: string[];
|
|
155
153
|
installations_count?: number | undefined;
|
|
@@ -31,6 +31,7 @@ export declare function getPullRequestReviewRequests(owner: string, repo: string
|
|
|
31
31
|
slug: string;
|
|
32
32
|
description: string | null;
|
|
33
33
|
privacy?: string | undefined;
|
|
34
|
+
notification_setting?: string | undefined;
|
|
34
35
|
permission: string;
|
|
35
36
|
permissions?: {
|
|
36
37
|
pull: boolean;
|
|
@@ -52,6 +53,7 @@ export declare function getPullRequestReviewRequests(owner: string, repo: string
|
|
|
52
53
|
description: string | null;
|
|
53
54
|
permission: string;
|
|
54
55
|
privacy?: string | undefined;
|
|
56
|
+
notification_setting?: string | undefined;
|
|
55
57
|
html_url: string;
|
|
56
58
|
repositories_url: string;
|
|
57
59
|
slug: string;
|
|
@@ -39,7 +39,7 @@ export declare function getPullRequestReviews(owner: string, repo: string, pullR
|
|
|
39
39
|
};
|
|
40
40
|
};
|
|
41
41
|
submitted_at?: string | undefined;
|
|
42
|
-
commit_id: string;
|
|
42
|
+
commit_id: string | null;
|
|
43
43
|
body_html?: string | undefined;
|
|
44
44
|
body_text?: string | undefined;
|
|
45
45
|
author_association: "COLLABORATOR" | "CONTRIBUTOR" | "FIRST_TIMER" | "FIRST_TIME_CONTRIBUTOR" | "MANNEQUIN" | "MEMBER" | "NONE" | "OWNER";
|
|
@@ -9,8 +9,9 @@ export declare function getWorkflowRunJobs(owner: string, repo: string, octokit:
|
|
|
9
9
|
head_sha: string;
|
|
10
10
|
url: string;
|
|
11
11
|
html_url: string | null;
|
|
12
|
-
status: "completed" | "queued" | "in_progress";
|
|
13
|
-
conclusion:
|
|
12
|
+
status: "completed" | "queued" | "in_progress" | "waiting";
|
|
13
|
+
conclusion: "skipped" | "success" | "neutral" | "failure" | "cancelled" | "timed_out" | "action_required" | null;
|
|
14
|
+
created_at: string;
|
|
14
15
|
started_at: string;
|
|
15
16
|
completed_at: string | null;
|
|
16
17
|
name: string;
|
|
@@ -28,4 +29,6 @@ export declare function getWorkflowRunJobs(owner: string, repo: string, octokit:
|
|
|
28
29
|
runner_name: string | null;
|
|
29
30
|
runner_group_id: number | null;
|
|
30
31
|
runner_group_name: string | null;
|
|
32
|
+
workflow_name: string | null;
|
|
33
|
+
head_branch: string | null;
|
|
31
34
|
}[]>;
|
package/lib/index.js
CHANGED
|
@@ -35,8 +35,8 @@ const FORMATTER = new Intl.NumberFormat(LOCALE, {
|
|
|
35
35
|
unitDisplay: 'long',
|
|
36
36
|
});
|
|
37
37
|
function handlePullRequest(pullRequestNumber) {
|
|
38
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
39
38
|
return __awaiter(this, void 0, void 0, function* () {
|
|
39
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
40
40
|
(0, core_1.startGroup)(`Pull Request number: ${pullRequestNumber}`);
|
|
41
41
|
const octokit = (0, getOcktokit_1.getOctokit)();
|
|
42
42
|
const owner = github_1.context.repo.owner;
|
|
@@ -282,4 +282,4 @@ function run() {
|
|
|
282
282
|
}
|
|
283
283
|
});
|
|
284
284
|
}
|
|
285
|
-
run();
|
|
285
|
+
run().catch((error) => (0, core_1.setFailed)(error));
|
package/lib/mergePullRequest.js
CHANGED
|
@@ -49,8 +49,8 @@ function checkIfPullRequestMerged(owner, repo, pullRequestNumber, octokit) {
|
|
|
49
49
|
}
|
|
50
50
|
exports.checkIfPullRequestMerged = checkIfPullRequestMerged;
|
|
51
51
|
function mergePullRequest(owner, repo, pullRequestNumber, mergeMethod, octokit) {
|
|
52
|
-
var _a, _b;
|
|
53
52
|
return __awaiter(this, void 0, void 0, function* () {
|
|
53
|
+
var _a, _b;
|
|
54
54
|
try {
|
|
55
55
|
yield octokit.rest.pulls.merge({
|
|
56
56
|
owner,
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "accept-to-ship-action",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.js",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"scripts": {
|
|
9
|
-
"build": "yarn tsc",
|
|
10
|
-
"package": "yarn ncc build src/index.ts --source-map --license licenses.txt",
|
|
9
|
+
"build": "rm -rf lib && yarn tsc",
|
|
10
|
+
"package": "rm -rf dist && yarn ncc build src/index.ts --external eslint --source-map --license licenses.txt",
|
|
11
11
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
12
|
-
"lint": "eslint -c .
|
|
12
|
+
"lint": "eslint -c eslint.config.js",
|
|
13
13
|
"preversion": "rm -rf lib && rm -rf dist && yarn && yarn build && yarn package"
|
|
14
14
|
},
|
|
15
15
|
"repository": {
|
|
@@ -22,25 +22,33 @@
|
|
|
22
22
|
"url": "https://github.com/CatChen/accept-to-ship-action/issues"
|
|
23
23
|
},
|
|
24
24
|
"homepage": "https://github.com/CatChen/accept-to-ship-action#readme",
|
|
25
|
+
"funding": "https://github.com/CatChen/accept-to-ship-action?sponsor=1",
|
|
25
26
|
"devDependencies": {
|
|
26
|
-
"@serverless-guru/prettier-plugin-import-order": "^0.
|
|
27
|
-
"@types/node": "^
|
|
28
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
29
|
-
"@typescript-eslint/parser": "^
|
|
30
|
-
"@vercel/ncc": "^0.
|
|
31
|
-
"eslint": "^
|
|
32
|
-
"eslint-config-prettier": "^
|
|
33
|
-
"eslint-plugin-prettier": "^
|
|
34
|
-
"husky": "^
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"typescript": "^
|
|
27
|
+
"@serverless-guru/prettier-plugin-import-order": "^0.4.1",
|
|
28
|
+
"@types/node": "^20.1.0",
|
|
29
|
+
"@typescript-eslint/eslint-plugin": "^7.10.0",
|
|
30
|
+
"@typescript-eslint/parser": "^7.10.0",
|
|
31
|
+
"@vercel/ncc": "^0.38.1",
|
|
32
|
+
"eslint": "^9.3.0",
|
|
33
|
+
"eslint-config-prettier": "^9.0.0",
|
|
34
|
+
"eslint-plugin-prettier": "^5.0.0",
|
|
35
|
+
"husky": "^9.0.11",
|
|
36
|
+
"lint-staged": "^15.2.5",
|
|
37
|
+
"prettier": "^3.0.2",
|
|
38
|
+
"typescript": "^5.0.2",
|
|
39
|
+
"typescript-eslint": "^7.10.0"
|
|
38
40
|
},
|
|
39
41
|
"dependencies": {
|
|
40
42
|
"@actions/core": "^1.10.0",
|
|
41
|
-
"@actions/github": "^
|
|
43
|
+
"@actions/github": "^6.0.0",
|
|
42
44
|
"@octokit/plugin-retry": "^3.0.9",
|
|
43
|
-
"@octokit/plugin-throttling": "^
|
|
45
|
+
"@octokit/plugin-throttling": "^5.0.1",
|
|
44
46
|
"@octokit/webhooks-definitions": "^3.67.3"
|
|
47
|
+
},
|
|
48
|
+
"lint-staged": {
|
|
49
|
+
"*.(ts,js)": "yarn lint --fix",
|
|
50
|
+
"*.json": "yarn prettier -w",
|
|
51
|
+
"*.(yml,yaml)": "yarn prettier -w",
|
|
52
|
+
"*.(md,markdown)": "yarn prettier -w"
|
|
45
53
|
}
|
|
46
54
|
}
|