Skip to content
This repository has been archived by the owner on Jun 8, 2023. It is now read-only.

Commit

Permalink
Add GitHub Enterprise support to github-issues
Browse files Browse the repository at this point in the history
  • Loading branch information
amaltson committed Jan 7, 2013
1 parent daca74a commit 6bf038a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/scripts/github-issues.coffee
Expand Up @@ -11,6 +11,7 @@
# HUBOT_GITHUB_USER
# HUBOT_GITHUB_REPO
# HUBOT_GITHUB_USER_(.*)
# HUBOT_GITHUB_API
#
# Commands:
# hubot show [me] [<limit> [of]] [<assignee>'s|my] [<label>] issues [for <user/repo>] [about <query>] -- Shows open GitHub issues for repo.
Expand All @@ -24,6 +25,8 @@
# 'johndoe1', you can ask `show john's issues` instead of `show johndoe1's
# issues`. This is useful for mapping chat handles to GitHub logins.
#
# HUBOT_GITHUB_API allows you to set a custom URL path (for Github enterprise users)
#
# Author:
# davidsiegel

Expand Down Expand Up @@ -81,7 +84,8 @@ module.exports = (robot) ->
query_params.labels = criteria.label if criteria.label?
query_params.assignee = criteria.assignee if criteria.assignee?

github.get "https://api.github.com/repos/#{criteria.repo}/issues", query_params, (issues) ->
base_url = process.env.HUBOT_GITHUB_API || 'https://api.github.com'
github.get "#{base_url}/repos/#{criteria.repo}/issues", query_params, (issues) ->
issues = filter_issues issues, criteria

if _.isEmpty issues
Expand Down

0 comments on commit 6bf038a

Please sign in to comment.