Skip to content

Commit 8eecc48

Browse files
committed
feat(bot): add /ping command to issue management bot
1 parent 8cba703 commit 8eecc48

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

.github/scripts/issue-management/main.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,14 @@ module.exports = async ({ github, context, core }) => {
4848
case 'claim':
4949
await handleClaim({ github, context });
5050
break;
51+
case 'ping':
52+
await github.rest.issues.createComment({
53+
owner,
54+
repo,
55+
issue_number: issueNumber,
56+
body: `🏓 **Pong!** CommitPulse Bot is online and fully operational.\n> UTC: ${new Date().toUTCString()}`,
57+
});
58+
break;
5159
}
5260
} catch (error) {
5361
core.error(`Error processing command /${parsed.command}: ${error.message}`);

.github/scripts/issue-management/parse-command.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ function parseCommand(commentBody) {
1515
const claimMatch = line.match(/^\/claim\s*$/i);
1616
if (claimMatch) return { command: 'claim' };
1717

18+
const pingMatch = line.match(/^\/ping\s*$/i);
19+
if (pingMatch) return { command: 'ping' };
20+
1821
const addlabelMatch = line.match(/^\/addlabel\s+(.+)$/i);
1922
if (addlabelMatch) {
2023
const labels = parseLabels(addlabelMatch[1]);

0 commit comments

Comments
 (0)