@wordpress/project-management-automation 1.13.1-next.5df0cd52b7.0 → 1.14.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/LICENSE.md +1 -1
- package/build-types/get-associated-pull-request.d.ts +1 -3
- package/build-types/get-associated-pull-request.d.ts.map +1 -1
- package/build-types/index.d.ts +1 -1
- package/build-types/index.d.ts.map +1 -1
- package/build-types/tasks/add-milestone/index.d.ts +3 -19
- package/build-types/tasks/add-milestone/index.d.ts.map +1 -1
- package/build-types/tasks/assign-fixed-issues/index.d.ts +2 -10
- package/build-types/tasks/assign-fixed-issues/index.d.ts.map +1 -1
- package/build-types/tasks/first-time-contributor-account-link/index.d.ts +3 -21
- package/build-types/tasks/first-time-contributor-account-link/index.d.ts.map +1 -1
- package/build-types/tasks/first-time-contributor-label/index.d.ts +2 -10
- package/build-types/tasks/first-time-contributor-label/index.d.ts.map +1 -1
- package/lib/tasks/add-milestone/index.js +9 -2
- package/lib/tasks/first-time-contributor-account-link/index.js +5 -3
- package/package.json +5 -3
- package/tsconfig.tsbuildinfo +1 -2044
- package/lib/test/has-wordpress-profile.js +0 -31
package/LICENSE.md
CHANGED
|
@@ -41,9 +41,7 @@ declare namespace getAssociatedPullRequest {
|
|
|
41
41
|
* TODO: If GitHub improves this on their own webhook payload types, this type
|
|
42
42
|
* should no longer be necessary.
|
|
43
43
|
*/
|
|
44
|
-
type WebhookPayloadPushCommit =
|
|
45
|
-
[x: string]: any;
|
|
46
|
-
};
|
|
44
|
+
type WebhookPayloadPushCommit = Record<string, any>;
|
|
47
45
|
type WebhookPayloadPushCommitAuthor = {
|
|
48
46
|
/**
|
|
49
47
|
* Author name.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-associated-pull-request.d.ts","sourceRoot":"","sources":["../lib/get-associated-pull-request.js"],"names":[],"mappings":";AAAA;;;;;;GAMG;AAEH;;;;;;;;;;;;;GAaG;AAEH;;;;;;;;;GASG;AACH,kDALW,wBAAwB,GAEvB,MAAM,QAMjB
|
|
1
|
+
{"version":3,"file":"get-associated-pull-request.d.ts","sourceRoot":"","sources":["../lib/get-associated-pull-request.js"],"names":[],"mappings":";AAAA;;;;;;GAMG;AAEH;;;;;;;;;;;;;GAaG;AAEH;;;;;;;;;GASG;AACH,kDALW,wBAAwB,GAEvB,MAAM,QAMjB;;;;;;;;;;;gCArBY,OAAO,MAAM,MAAG;;;;;UAZf,MAAM;;;;WACN,MAAM;;;;cACN,MAAM"}
|
package/build-types/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Automation task function.
|
|
3
3
|
*/
|
|
4
|
-
export type WPAutomationTask =
|
|
4
|
+
export type WPAutomationTask = WPAutomationTask;
|
|
5
5
|
/**
|
|
6
6
|
* Full list of automations, matched by given properties against the incoming
|
|
7
7
|
* payload object.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../lib/index.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../lib/index.js"],"names":[],"mappings":";;;;;;;;;;;;WA2Bc,MAAM;;;;;;;;UAEN,gBAAgB"}
|
|
@@ -9,23 +9,7 @@ declare function addMilestone(payload: WebhookPayloadPush, octokit: GitHub): Pro
|
|
|
9
9
|
declare namespace addMilestone {
|
|
10
10
|
export { RequestError, GitHub, WebhookPayloadPush };
|
|
11
11
|
}
|
|
12
|
-
type WebhookPayloadPush =
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
after: string;
|
|
16
|
-
created: boolean;
|
|
17
|
-
deleted: boolean;
|
|
18
|
-
forced: boolean;
|
|
19
|
-
base_ref: null;
|
|
20
|
-
compare: string;
|
|
21
|
-
commits: any[];
|
|
22
|
-
head_commit: null;
|
|
23
|
-
repository: import("@octokit/webhooks").PayloadRepository;
|
|
24
|
-
pusher: import("@octokit/webhooks").WebhookPayloadPushPusher;
|
|
25
|
-
sender: import("@octokit/webhooks").WebhookPayloadPushSender;
|
|
26
|
-
};
|
|
27
|
-
type GitHub = import("@octokit/core").Octokit & import("@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-types/types").Api & {
|
|
28
|
-
paginate: import("@actions/github/node_modules/@octokit/plugin-paginate-rest").PaginateInterface;
|
|
29
|
-
};
|
|
30
|
-
type RequestError = import("@octokit/request-error").RequestError;
|
|
12
|
+
type WebhookPayloadPush = import('@octokit/webhooks').WebhookPayloadPush;
|
|
13
|
+
type GitHub = ReturnType<typeof import("@actions/github").getOctokit>;
|
|
14
|
+
type RequestError = import('@octokit/request-error').RequestError;
|
|
31
15
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/tasks/add-milestone/index.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/tasks/add-milestone/index.js"],"names":[],"mappings":";AAuEA;;;;;GAKG;AACH,uCAHW,kBAAkB,WAClB,MAAM,iBA+HhB;;;;0BAlMa,OAAO,mBAAmB,EAAE,kBAAkB;cAD9C,uDAAgD;oBADhD,OAAO,wBAAwB,EAAE,YAAY"}
|
|
@@ -11,14 +11,6 @@ declare function assignFixedIssues(payload: WebhookPayloadPullRequest, octokit:
|
|
|
11
11
|
declare namespace assignFixedIssues {
|
|
12
12
|
export { GitHub, WebhookPayloadPullRequest };
|
|
13
13
|
}
|
|
14
|
-
type WebhookPayloadPullRequest =
|
|
15
|
-
|
|
16
|
-
number: number;
|
|
17
|
-
pull_request: import("@octokit/webhooks").WebhookPayloadPullRequestPullRequest;
|
|
18
|
-
repository: import("@octokit/webhooks").PayloadRepository;
|
|
19
|
-
sender: import("@octokit/webhooks").WebhookPayloadPullRequestSender;
|
|
20
|
-
};
|
|
21
|
-
type GitHub = import("@octokit/core").Octokit & import("@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-types/types").Api & {
|
|
22
|
-
paginate: import("@actions/github/node_modules/@octokit/plugin-paginate-rest").PaginateInterface;
|
|
23
|
-
};
|
|
14
|
+
type WebhookPayloadPullRequest = import('@octokit/webhooks').WebhookPayloadPullRequest;
|
|
15
|
+
type GitHub = ReturnType<typeof import("@actions/github").getOctokit>;
|
|
24
16
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/tasks/assign-fixed-issues/index.js"],"names":[],"mappings":";AAKA,yEAAyE;AACzE,iGAAiG;AAEjG;;;;;GAKG;AACH,4CAHW,yBAAyB,WACzB,MAAM,iBA+BhB"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/tasks/assign-fixed-issues/index.js"],"names":[],"mappings":";AAKA,yEAAyE;AACzE,iGAAiG;AAEjG;;;;;GAKG;AACH,4CAHW,yBAAyB,WACzB,MAAM,iBA+BhB;;;;iCArCa,OAAO,mBAAmB,EAAE,yBAAyB;cADrD,uDAAgD"}
|
|
@@ -10,25 +10,7 @@ declare function firstTimeContributorAccountLink(payload: WebhookPayloadPush, oc
|
|
|
10
10
|
declare namespace firstTimeContributorAccountLink {
|
|
11
11
|
export { GitHub, WebhookPayloadPush, WebhookPayloadPushCommit };
|
|
12
12
|
}
|
|
13
|
-
type WebhookPayloadPush =
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
after: string;
|
|
17
|
-
created: boolean;
|
|
18
|
-
deleted: boolean;
|
|
19
|
-
forced: boolean;
|
|
20
|
-
base_ref: null;
|
|
21
|
-
compare: string;
|
|
22
|
-
commits: any[];
|
|
23
|
-
head_commit: null;
|
|
24
|
-
repository: import("@octokit/webhooks").PayloadRepository;
|
|
25
|
-
pusher: import("@octokit/webhooks").WebhookPayloadPushPusher;
|
|
26
|
-
sender: import("@octokit/webhooks").WebhookPayloadPushSender;
|
|
27
|
-
};
|
|
28
|
-
type GitHub = import("@octokit/core").Octokit & import("@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-types/types").Api & {
|
|
29
|
-
paginate: import("@actions/github/node_modules/@octokit/plugin-paginate-rest").PaginateInterface;
|
|
30
|
-
};
|
|
31
|
-
type WebhookPayloadPushCommit = {
|
|
32
|
-
[x: string]: any;
|
|
33
|
-
};
|
|
13
|
+
type WebhookPayloadPush = import('@octokit/webhooks').WebhookPayloadPush;
|
|
14
|
+
type GitHub = ReturnType<typeof import("@actions/github").getOctokit>;
|
|
15
|
+
type WebhookPayloadPushCommit = import('../../get-associated-pull-request').WebhookPayloadPushCommit;
|
|
34
16
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/tasks/first-time-contributor-account-link/index.js"],"names":[],"mappings":";AAkCA;;;;;;GAMG;AACH,0DAHW,kBAAkB,WAClB,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/tasks/first-time-contributor-account-link/index.js"],"names":[],"mappings":";AAkCA;;;;;;GAMG;AACH,0DAHW,kBAAkB,WAClB,MAAM,iBA0EhB;;;;0BAzGa,OAAO,mBAAmB,EAAE,kBAAkB;cAD9C,uDAAgD;gCAEhD,OAAO,mCAAmC,EAAE,wBAAwB"}
|
|
@@ -11,14 +11,6 @@ declare function firstTimeContributorLabel(payload: WebhookPayloadPullRequest, o
|
|
|
11
11
|
declare namespace firstTimeContributorLabel {
|
|
12
12
|
export { GitHub, WebhookPayloadPullRequest };
|
|
13
13
|
}
|
|
14
|
-
type WebhookPayloadPullRequest =
|
|
15
|
-
|
|
16
|
-
number: number;
|
|
17
|
-
pull_request: import("@octokit/webhooks").WebhookPayloadPullRequestPullRequest;
|
|
18
|
-
repository: import("@octokit/webhooks").PayloadRepository;
|
|
19
|
-
sender: import("@octokit/webhooks").WebhookPayloadPullRequestSender;
|
|
20
|
-
};
|
|
21
|
-
type GitHub = import("@octokit/core").Octokit & import("@actions/github/node_modules/@octokit/plugin-rest-endpoint-methods/dist-types/types").Api & {
|
|
22
|
-
paginate: import("@actions/github/node_modules/@octokit/plugin-paginate-rest").PaginateInterface;
|
|
23
|
-
};
|
|
14
|
+
type WebhookPayloadPullRequest = import('@octokit/webhooks').WebhookPayloadPullRequest;
|
|
15
|
+
type GitHub = ReturnType<typeof import("@actions/github").getOctokit>;
|
|
24
16
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/tasks/first-time-contributor-label/index.js"],"names":[],"mappings":";AAKA,yEAAyE;AACzE,iGAAiG;AAEjG;;;;;GAKG;AACH,oDAHW,yBAAyB,WACzB,MAAM,iBAoDhB"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/tasks/first-time-contributor-label/index.js"],"names":[],"mappings":";AAKA,yEAAyE;AACzE,iGAAiG;AAEjG;;;;;GAKG;AACH,oDAHW,yBAAyB,WACzB,MAAM,iBAoDhB;;;;iCA1Da,OAAO,mBAAmB,EAAE,yBAAyB;cADrD,uDAAgD"}
|
|
@@ -19,7 +19,7 @@ const DAYS_PER_RELEASE = 14;
|
|
|
19
19
|
* Returns true if the given error object represents a duplicate entry error, or
|
|
20
20
|
* false otherwise.
|
|
21
21
|
*
|
|
22
|
-
* @param {
|
|
22
|
+
* @param {unknown} requestError Error to test.
|
|
23
23
|
*
|
|
24
24
|
* @return {boolean} Whether error is a duplicate validation request error.
|
|
25
25
|
*/
|
|
@@ -27,7 +27,14 @@ const isDuplicateValidationError = ( requestError ) => {
|
|
|
27
27
|
// The included version of RequestError provides no way to access the
|
|
28
28
|
// full 'errors' array that the github REST API returns. Hopefully they
|
|
29
29
|
// resolve this soon!
|
|
30
|
-
|
|
30
|
+
const errorMessage =
|
|
31
|
+
requestError &&
|
|
32
|
+
typeof requestError === 'object' &&
|
|
33
|
+
/** @type {{message?: string}} */ ( requestError ).message;
|
|
34
|
+
return (
|
|
35
|
+
typeof errorMessage === 'string' &&
|
|
36
|
+
errorMessage.includes( 'already_exists' )
|
|
37
|
+
);
|
|
31
38
|
};
|
|
32
39
|
|
|
33
40
|
/**
|
|
@@ -86,9 +86,11 @@ async function firstTimeContributorAccountLink( payload, octokit ) {
|
|
|
86
86
|
try {
|
|
87
87
|
hasProfile = await hasWordPressProfile( author );
|
|
88
88
|
} catch ( error ) {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
89
|
+
if ( error instanceof Object ) {
|
|
90
|
+
debug(
|
|
91
|
+
`first-time-contributor-account-link: Error retrieving from profile API:\n\n${ error.toString() }`
|
|
92
|
+
);
|
|
93
|
+
}
|
|
92
94
|
return;
|
|
93
95
|
}
|
|
94
96
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/project-management-automation",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.14.0",
|
|
4
4
|
"description": "GitHub Action that implements various automation to assist with managing the Gutenberg GitHub repository.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -24,10 +24,12 @@
|
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@actions/core": "^1.4.0",
|
|
26
26
|
"@actions/github": "^5.0.0",
|
|
27
|
-
"@babel/runtime": "^7.
|
|
27
|
+
"@babel/runtime": "^7.16.0",
|
|
28
|
+
"@octokit/request-error": "^2.1.0",
|
|
29
|
+
"@octokit/webhooks": "^7.1.0"
|
|
28
30
|
},
|
|
29
31
|
"publishConfig": {
|
|
30
32
|
"access": "public"
|
|
31
33
|
},
|
|
32
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "d95ccb9366e249133cdb1d7b25c382446b9ee502"
|
|
33
35
|
}
|