Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion GitGitGadget/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ module.exports = async (context, req) => {
}

/* Only trigger the Pipeline for valid commands */
if (!comment.body || !comment.body.match(/^\/(submit|preview|allow|disallow|test|cc)\b/)) {
if (!comment.body || !comment.body.match(/^\/(submit|preview|allow|disallow|test|cc|reply)\b/)) {
context.res = {
body: `Not a command: '${comment.body}'`,
};
Expand Down
9 changes: 9 additions & 0 deletions __tests__/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,15 @@ testIssueComment('/test', async (context) => {
expect(mockRequest.end).not.toHaveBeenCalled()
})

testIssueComment('/reply <mail@example.com>\nThanks', async (context) => {
expect(context.done).not.toHaveBeenCalled()
expect(context.res).toEqual({
body: 'Okay, triggered <the URL to the workflow handle-pr-comment.yml run on main with inputs {"pr-comment-url":"https://github.com/gitgitgadget/git/pull/1886743660"}>!'
})
expect(mockRequest.write).not.toHaveBeenCalled()
expect(mockRequest.end).not.toHaveBeenCalled()
})

testIssueComment('/verify-repository', 'nope', (context) => {
expect(context.done).not.toHaveBeenCalled()
expect(context.res).toEqual({
Expand Down
Loading