rename option to recreate

This commit is contained in:
Jake Hiller 2020-06-24 09:33:22 -04:00
parent eb64714cc1
commit 1ec19bd242
2 changed files with 3 additions and 3 deletions

View file

@ -8,7 +8,7 @@ inputs:
append:
description: "Indicate if new comment messages should be appended to previous comment message"
required: false
replace:
recreate:
description: "Indicate if previous comment should be removed before creating a new comment"
required: false
message:

View file

@ -18,7 +18,7 @@ async function run() {
const path = core.getInput("path", { required: false });
const header = core.getInput("header", { required: false }) || "";
const append = core.getInput("append", { required: false }) || false;
const replace = core.getInput("replace", { required: false }) || false;
const recreate = core.getInput("recreate", { required: false }) || false;
const githubToken = core.getInput("GITHUB_TOKEN", { required: true });
const octokit = new GitHub(githubToken);
const previous = await findPreviousComment(octokit, repo, number, header);
@ -37,7 +37,7 @@ async function run() {
if (previous) {
const previousBody = append && previous.body;
if (replace) {
if (recreate) {
await deleteComment(octokit, repo, previous.id);
await createComment(octokit, repo, number, body, header, previousBody);
} else {