Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checklist test #1

Closed
wants to merge 10 commits into from
57 changes: 6 additions & 51 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9805,59 +9805,14 @@ module.exports = Object.freeze({

const { getOctokit, maybeForbidden } = __nccwpck_require__(1608);


const message_sign = '​ ​​​​​​​​ ​​​​​​​';


const send = async (context, message) => {
const octokit = getOctokit(context);

const comments = (await maybeForbidden(
octokit.rest.issues.listComments,
{
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
},
)).data;
const previous_comment = comments.filter(comment => comment.body.endsWith(message_sign))[0];

if (!message.length) {
if (previous_comment) {
await maybeForbidden(
octokit.rest.issues.deleteComment,
{
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: previous_comment.id,
},
);
};
} else {
if (comments.length && previous_comment) {
await maybeForbidden(
octokit.rest.issues.updateComment,
{
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: previous_comment.id,
body: message.trim() + message_sign,
},
);
} else {
await maybeForbidden(
octokit.rest.issues.createComment,
{
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: message.trim() + message_sign,
},
);
};
};
};
if (message) {
console.error(message);
return process.exit(1);
}

console.log('https://genius.com/images/extreme.jpg');
};

module.exports = Object.freeze({
send,
Expand Down