Skip to content

Commit

Permalink
npm run build
Browse files Browse the repository at this point in the history
  • Loading branch information
mlahargou committed Apr 2, 2024
1 parent ad056f5 commit e26105f
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9554,8 +9554,8 @@ async function run() {
const reactions = core.getInput('reactions');
const mode = core.getInput('mode');
const create_if_not_exists = core.getInput('create_if_not_exists') === 'true';
if (!message && !filePath) {
core.setFailed('Either "filePath" or "message" should be provided as input');
if (!message && !filePath && mode !== 'only-delete') {
core.setFailed('Either "filePath" or "message" should be provided as input unless running as "only-delete".');
return;
}
let content = message;
Expand Down Expand Up @@ -9651,14 +9651,25 @@ async function run() {
});
return;
}
else if (mode === 'only-delete') {
await deleteComment({
...context.repo,
comment_id: comment.id,
});
return;
}
else if (mode === 'delete') {
core.debug('Registering this comment to be deleted.');
}
else {
core.setFailed(`Mode ${mode} is unknown. Please use 'upsert', 'recreate' or 'delete'.`);
core.setFailed(`Mode ${mode} is unknown. Please use 'upsert', 'recreate', 'delete', or 'only-delete'.`);
return;
}
}
else if (mode === 'only-delete') {
core.info('No comment has been found with asked pattern. Nothing to delete.');
return;
}
else if (create_if_not_exists) {
core.info('No comment has been found with asked pattern. Creating a new comment.');
}
Expand Down

0 comments on commit e26105f

Please sign in to comment.