Skip to content

Commit

Permalink
Merge pull request #110 from ropensci-org/xuanxu-patch-1
Browse files Browse the repository at this point in the history
Update regex to allow intermediate periods in package names
  • Loading branch information
mpadge authored Jan 23, 2025
2 parents 500cfa0 + 05f7420 commit 93d01eb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/responders/ropensci/approve_responder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class ApproveResponder < Responder

def define_listening
@event_action = "issue_comment.created"
@event_regex = /\A@#{bot_name} approve( [ \w-]+)?\.?\s*\z/i
@event_regex = /\A@#{bot_name} approve( [\.\w-]*[\w-]+)?\.?\s*\z/i
end

def process_message(message)
Expand Down
1 change: 1 addition & 0 deletions spec/responders/ropensci/approve_responder_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
it "should define regex" do
expect(@responder.event_regex).to match("@ropensci-review-bot approve")
expect(@responder.event_regex).to match("@ropensci-review-bot approve package-name")
expect(@responder.event_regex).to match("@ropensci-review-bot approve package.name")
expect(@responder.event_regex).to match("@ropensci-review-bot approve package-name \r\n")
expect(@responder.event_regex).to_not match("@ropensci-review-bot approve package-name. another-command")
expect(@responder.event_regex).to_not match("@ropensci-review-bot approve package-name\r\nanother-command")
Expand Down

0 comments on commit 93d01eb

Please sign in to comment.