Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
6 changes: 3 additions & 3 deletions client/src/components/actiondashboard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
<v-text-field v-model="search" label="Search" class="mx-4"></v-text-field>
</template>
<template v-slot:item.workflow="{ item }">
<a :href="`https://github.com/${item.owner}/${item.repo}/actions?query=workflow%3A${item.workflow}`" target="_blank">{{ item.workflow }}</a>
<a :href="`https://${item.host}/${item.owner}/${item.repo}/actions?query=workflow%3A${item.workflow}`" target="_blank">{{ item.workflow }}</a>
</template>
<template v-slot:item.message="{ item }">
<a :href="`https://github.com/${item.owner}/${item.repo}/actions/runs/${item.runId}`" target="_blank">{{ item.message }}</a>
<a :href="`https://${item.host}/${item.owner}/${item.repo}/actions/runs/${item.runId}`" target="_blank">{{ item.message }}</a>
</template>
<template v-slot:item.sha="{ item }">
<a :href="`https://github.com/${item.owner}/${item.repo}/commit/${item.sha}`" target="_blank">{{ item.sha.substr(0, 8) }}</a>
<a :href="`https://${item.host}/${item.owner}/${item.repo}/commit/${item.sha}`" target="_blank">{{ item.sha.substr(0, 8) }}</a>
</template>

<template v-slot:item.status="{ item }">
Expand Down
4 changes: 3 additions & 1 deletion configure.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const {
GITHUB_APP_WEBHOOK_PATH = "/",
GITHUB_ORG,
GITHUB_USERNAME,
GHE_HOST,
} = process.env;

// Handles newlines \n in private key
Expand All @@ -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);
Expand Down
8 changes: 7 additions & 1 deletion github.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ class GitHub {
_privateKey,
_clientId,
_clientSecret,
_installationId
_installationId,
_gheHost
) {
this._gheHost = _gheHost;
this._org = _org;
this._user = _user;
this._appId = _appId;
Expand All @@ -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(
Expand Down Expand Up @@ -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,
Expand Down