Skip to content

output issue urls when they are mentioned in chat #1

@benwtr

Description

@benwtr

totally untested, just wrote this here, probably won't work on the first try:

robot.hear /(?:gh|github) issue #(\d+)(?: in ([\w\d-_]+)(?:\/([\w\d-_]+))?)?/i, id:'gh-issues.mention', (msg) ->
  id = msg.match[1]
    repo = if msg.match[2]? and msg.match[3]?
    "#{msg.match[2]}/#{msg.match[3]}"
  else if msg.match[2]?
    "#{DEFAULT_OWNER}/#{msg.match[2]}"
  else
    "#{DEFAULT_OWNER}/#{DEFAULT_REPO}"
  robot.ghissues.showIssue msg, id, repo

So you should then be able to mention issues in a chat:

User> So I says to Mabel, I says check out gh issue #4832742 in hubot-scripts/hubot-gh-issues
Hubot> Issue #4832742 in hubot-scripts/hubot-gh-issues - foo - https://github.com/hubot-scripts/hubot-gh-issues/issue/4832742

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions