Enhance GitHub webhook introducing allowing usage for GitHub Enterprise. (#321)

diff --git a/packages/github/README.md b/packages/github/README.md
index b0b9ad7..9587f1c 100644
--- a/packages/github/README.md
+++ b/packages/github/README.md
@@ -38,6 +38,7 @@
 - `repository`: The GitHub repository.
 - `accessToken`: Your GitHub personal access token.
 - `events`: The [GitHub event type](https://developer.github.com/v3/activity/events/types/) of interest.
+- `baseUrl`: The GitHub api endpoint. Default value is 'https://api.github.com'.
 
 The following is an example of creating a trigger that will be fired each time that there is a new commit to a GitHub repository.
 
@@ -52,6 +53,7 @@
 
   ```
   wsk package bind /whisk.system/github myGit \
+    --param baseUrl https://github.myenterprise.com/api/v3 \
     --param username myGitUser \
     --param repository myGitRepo \
     --param accessToken aaaaa1111a1a1a1a1a111111aaaaaa1111aa1a1a
diff --git a/packages/github/manifest.yaml b/packages/github/manifest.yaml
index 10377b4..022ace4 100644
--- a/packages/github/manifest.yaml
+++ b/packages/github/manifest.yaml
@@ -55,11 +55,18 @@
                                 "required": true,
                                 "description": "A comma-separated list",
                                 "doclink": "https://developer.github.com/webhooks/#events"
+                            },
+                            {
+                                "name": "baseUrl",
+                                "required": false,
+                                "description": "GitHub API endpoint",
+                                "doclink": "https://docs.github.com/en/enterprise-server@2.21/rest/reference/enterprise-admin#endpoint-urls"
                             }
                         ]
                         sampleInput: {
                             "username": "myUserName",
                             "repository": "myRepository or myOrganization/myRepository",
                             "accessToken": "123ABCXYZ",
-                            "events": "push, delete, pull-request"
+                            "events": "push, delete, pull-request",
+                            "baseUrl": "https://github.myenterprise.com/api/v3"
                         }
diff --git a/packages/github/webhook.js b/packages/github/webhook.js
index 6ce156d..6e5563b 100644
--- a/packages/github/webhook.js
+++ b/packages/github/webhook.js
@@ -32,7 +32,14 @@
   var accessToken = params.accessToken;
 
   var organization,
-    repository;
+    repository,
+    baseUrl;
+
+  if (params.baseUrl) {
+    baseUrl = params.baseUrl;
+  } else {
+    baseUrl = 'https://api.github.com';
+  }
 
   if (params.repository) {
     var repoSegments = params.repository.split('/');
@@ -52,7 +59,7 @@
   var whiskCallbackUrl = urlHost.protocol + '//' + process.env.__OW_API_KEY + "@" + urlHost.host + '/api/v1/namespaces/' + encodeURIComponent(triggerName[1]) + '/triggers/' + encodeURIComponent(triggerName[2]);
 
   // The URL to create the webhook on Github
-  var registrationEndpoint = 'https://api.github.com/repos/' + (organization ? organization : username) + '/' + repository + '/hooks';
+  var registrationEndpoint = baseUrl +'/repos/' + (organization ? organization : username) + '/' + repository + '/hooks';
   console.log("Using endpoint: " + registrationEndpoint);
 
   if (lifecycleEvent === 'CREATE') {