Skip to content

Commit

Permalink
Merge pull request #141 from icub-tech-iit/fix/escape-char
Browse files Browse the repository at this point in the history
Changed the escape char for group mentioning
  • Loading branch information
pattacini authored May 20, 2022
2 parents 279a92d + d7da665 commit ce0bc6d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,11 @@ Pay attention to the following points:

### Mentioning a group
Anyone posting a message in an issue or a PR of a org repository where the outside collaborators automation is
established can mention a group using the following _bash-like_ convention:
- `$group-name`
- `${group-name}`
established can mention a group using the convention `!group-name`.

For example, if `user01` posts:
```markdown
Hey ${lab_xyz/group01} 👋🏻
Hey !lab_xyz/group01 👋🏻
I've got an exciting news to share with you!
```

Expand Down
8 changes: 3 additions & 5 deletions scripts/mentioning-comment-handler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,10 @@
collaborators = ""
repo_metadata.each { |user, props|
if (props["type"].casecmp?("group")) then
tag_1 = "$" + user
tag_2 = "${" + user + "}"
if (body.include? tag_1) || (body.include? tag_2) then
tag = "!" + user
if body.include? tag then
# avoid self-notifying
body = body.gsub(tag_1, user)
body = body.gsub(tag_2, user)
body = body.gsub(tag, user)
if groups.key?(user) then
puts "- Handling of notified group \"#{user}\" 👥"
groups[user].each { |subuser|
Expand Down

0 comments on commit ce0bc6d

Please sign in to comment.