paperclip-github-plugin 0.5.0 → 0.5.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 +1 -1
- package/dist/manifest.js +1 -1
- package/dist/ui/index.js +226 -49
- package/dist/ui/index.js.map +2 -2
- package/dist/worker.js +6 -3
- package/package.json +1 -1
package/dist/worker.js
CHANGED
|
@@ -9912,11 +9912,14 @@ async function reviewProjectPullRequest(ctx, input) {
|
|
|
9912
9912
|
if (!pullRequestNumber) {
|
|
9913
9913
|
throw new Error("pullRequestNumber is required.");
|
|
9914
9914
|
}
|
|
9915
|
-
const reviewType = input.review === "approve" ? "APPROVE" : input.review === "request_changes" ? "REQUEST_CHANGES" : void 0;
|
|
9915
|
+
const reviewType = input.review === "approve" ? "APPROVE" : input.review === "request_changes" ? "REQUEST_CHANGES" : input.review === "comment" ? "COMMENT" : void 0;
|
|
9916
9916
|
if (!reviewType) {
|
|
9917
|
-
throw new Error('review must be "approve" or "
|
|
9917
|
+
throw new Error('review must be "approve", "request_changes", or "comment".');
|
|
9918
9918
|
}
|
|
9919
9919
|
const body = typeof input.body === "string" ? input.body.trim() : "";
|
|
9920
|
+
if (reviewType === "COMMENT" && !body) {
|
|
9921
|
+
throw new Error("Add a review summary before submitting a comment-only review.");
|
|
9922
|
+
}
|
|
9920
9923
|
const scope = await requireProjectPullRequestScope(ctx, input);
|
|
9921
9924
|
const octokit = await createGitHubToolOctokit(ctx, scope.companyId);
|
|
9922
9925
|
let response;
|
|
@@ -9943,7 +9946,7 @@ async function reviewProjectPullRequest(ctx, input) {
|
|
|
9943
9946
|
invalidateProjectPullRequestCaches(scope);
|
|
9944
9947
|
return {
|
|
9945
9948
|
reviewId: response.data.id,
|
|
9946
|
-
review: reviewType === "APPROVE" ? "approved" : "changes_requested",
|
|
9949
|
+
review: reviewType === "APPROVE" ? "approved" : reviewType === "REQUEST_CHANGES" ? "changes_requested" : "commented",
|
|
9947
9950
|
reviewUrl: response.data.html_url ?? `${scope.repository.url}/pull/${pullRequestNumber}`
|
|
9948
9951
|
};
|
|
9949
9952
|
}
|