Skip to content

Commit

Permalink
Tighten up regex
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenyeargin committed Apr 4, 2024
1 parent b8dfaeb commit 4fc0cdf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/scripts/pagerduty.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ module.exports = function (robot) {
msg.send("Okay, I've forgotten your PagerDuty email");
});

robot.respond(/(pager|major)( me)? incident (.*)$/i, function (msg) {
robot.respond(/(pager|major)( me)? incident ([a-z0-9]+)$/i, function (msg) {
msg.finish();

if (pagerduty.missingEnvironmentForApi(msg)) {
Expand Down
2 changes: 1 addition & 1 deletion test/pager-me-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ describe('pagerduty', function () {
});

it('registers a pager incident listener', function () {
expect(this.robot.respond).to.have.been.calledWith(/(pager|major)( me)? incident (.*)$/i);
expect(this.robot.respond).to.have.been.calledWith(/(pager|major)( me)? incident ([a-z0-9]+)$/i);
});

it('registers a pager sup listener', function () {
Expand Down

0 comments on commit 4fc0cdf

Please sign in to comment.