apply suggestions

This commit is contained in:
WebFreak001 2023-02-09 18:42:37 +01:00
parent 7f05636c59
commit b2b0280464
No known key found for this signature in database
GPG key ID: AEFC88D11109D1AA
5 changed files with 10 additions and 10 deletions

View file

@ -19,7 +19,7 @@ inputs:
default: "false" default: "false"
required: false required: false
only_create: only_create:
description: "only create a new comment if there is no existing one, otherwise do nothing. Only `true` is allowed. Just skip this item when you don't need it." description: "only create a new comment if there is no existing one, otherwise do nothing. Only `true` is allowed. Just skip this item when you don't need it. This options has higher priority than hide_and_recreate, hide."
default: "false" default: "false"
required: false required: false
hide_details: hide_details:

8
dist/index.js generated vendored
View file

@ -229,7 +229,7 @@ exports.hideClassify = core.getInput("hide_classify", {
}); });
exports.deleteOldComment = core.getBooleanInput("delete", { required: true }); exports.deleteOldComment = core.getBooleanInput("delete", { required: true });
exports.onlyCreateComment = core.getBooleanInput("only_create", { exports.onlyCreateComment = core.getBooleanInput("only_create", {
required: false required: true
}); });
exports.hideOldComment = core.getBooleanInput("hide", { required: true }); exports.hideOldComment = core.getBooleanInput("hide", { required: true });
exports.githubToken = core.getInput("GITHUB_TOKEN", { required: true }); exports.githubToken = core.getInput("GITHUB_TOKEN", { required: true });
@ -350,9 +350,9 @@ function run() {
yield (0, comment_1.createComment)(octokit, config_1.repo, config_1.pullRequestNumber, body, config_1.header); yield (0, comment_1.createComment)(octokit, config_1.repo, config_1.pullRequestNumber, body, config_1.header);
return; return;
} }
if (previous && config_1.onlyCreateComment) { if (config_1.onlyCreateComment) {
// don't comment anything, user specified only_create, so this is probably // don't comment anything, user specified only_create and there is an
// a placeholder / introduction comment. // existing comment, so this is probably a placeholder / introduction one.
return; return;
} }
if (config_1.hideOldComment) { if (config_1.hideOldComment) {

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

View file

@ -23,7 +23,7 @@ export const hideClassify = core.getInput("hide_classify", {
}) as ReportedContentClassifiers }) as ReportedContentClassifiers
export const deleteOldComment = core.getBooleanInput("delete", {required: true}) export const deleteOldComment = core.getBooleanInput("delete", {required: true})
export const onlyCreateComment = core.getBooleanInput("only_create", { export const onlyCreateComment = core.getBooleanInput("only_create", {
required: false required: true
}) })
export const hideOldComment = core.getBooleanInput("hide", {required: true}) export const hideOldComment = core.getBooleanInput("hide", {required: true})
export const githubToken = core.getInput("GITHUB_TOKEN", {required: true}) export const githubToken = core.getInput("GITHUB_TOKEN", {required: true})

View file

@ -71,9 +71,9 @@ async function run(): Promise<undefined> {
return return
} }
if (previous && onlyCreateComment) { if (onlyCreateComment) {
// don't comment anything, user specified only_create, so this is probably // don't comment anything, user specified only_create and there is an
// a placeholder / introduction comment. // existing comment, so this is probably a placeholder / introduction one.
return return
} }