diff --git a/README.md b/README.md
index cb26cc6..d5272c2 100644
--- a/README.md
+++ b/README.md
@@ -71,6 +71,7 @@ The dashboard has all of it's parameters passed via environment variables.
- GITHUB_APP_WEBHOOK_PORT - Optional, defaults to 8081. If set to the same as PORT must also specify GITHUB_APP_WEBHOOK_PATH
- GITHUB_APP_WEBHOOK_PATH - Optional if WebHooks running on different port than main site, defaults to /, if running on the same port defaults to /webhook.
- LOOKBACK_DAYS - Optional, defaults to 7. Number of days to look in the past for workflow runs.
+- GHE_HOST - Optional, defaults to github.com. If you are using GitHub Enterprise.
- DEBUG=action-dashboard:\* - Optional setting to help in debugging
### Installation Id
diff --git a/actions.js b/actions.js
index dcb4657..fac10d6 100644
--- a/actions.js
+++ b/actions.js
@@ -56,6 +56,7 @@ class Actions {
: runs[0].status,
createdAt: runs[0].created_at,
updatedAt: runs[0].updated_at,
+ host: this._gitHub._gheHost ? this._gitHub._gheHost : "github.com",
});
} else {
debug(
diff --git a/client/src/components/actiondashboard.vue b/client/src/components/actiondashboard.vue
index 8d4868b..6d757ad 100644
--- a/client/src/components/actiondashboard.vue
+++ b/client/src/components/actiondashboard.vue
@@ -18,13 +18,13 @@
- {{ item.workflow }}
+ {{ item.workflow }}
- {{ item.message }}
+ {{ item.message }}
- {{ item.sha.substr(0, 8) }}
+ {{ item.sha.substr(0, 8) }}
diff --git a/configure.js b/configure.js
index bda4487..626cae3 100644
--- a/configure.js
+++ b/configure.js
@@ -34,6 +34,7 @@ const {
GITHUB_APP_WEBHOOK_PATH = "/",
GITHUB_ORG,
GITHUB_USERNAME,
+ GHE_HOST,
} = process.env;
// Handles newlines \n in private key
@@ -56,7 +57,8 @@ module.exports = {
GITHUB_APP_PRIVATEKEY,
GITHUB_APP_CLIENTID,
GITHUB_APP_CLIENTSECRET,
- GITHUB_APP_INSTALLATIONID
+ GITHUB_APP_INSTALLATIONID,
+ GHE_HOST
);
_runStatus = new RunStatus();
const actions = new Actions(gitHub, _runStatus, LOOKBACK_DAYS);
diff --git a/github.js b/github.js
index cd88ec6..8f8946b 100644
--- a/github.js
+++ b/github.js
@@ -12,8 +12,10 @@ class GitHub {
_privateKey,
_clientId,
_clientSecret,
- _installationId
+ _installationId,
+ _gheHost
) {
+ this._gheHost = _gheHost;
this._org = _org;
this._user = _user;
this._appId = _appId;
@@ -32,6 +34,7 @@ class GitHub {
installationId: _installationId,
},
authStrategy: createAppAuth,
+ baseUrl: (this._gheHost) ? `https://${this._gheHost}/api/v3` : "https://api.github.com",
throttle: {
onRateLimit: (retryAfter, options) => {
console.error(
@@ -86,6 +89,9 @@ class GitHub {
async getUsage(repoOwner, repoName, workflowId, run_id) {
try {
+ if (this._gheHost)
+ return null;
+
const usage = await this._octokit.actions.getWorkflowRunUsage({
repo: repoName,
owner: repoOwner,