feat(github-actions-plugin): default links to GitHub host in app config if defined

Signed-off-by: Phil Kuang <pkuang@factset.com>
This commit is contained in:
Phil Kuang
2021-03-04 14:24:05 -05:00
parent d661bece6a
commit 13fb84244b
3 changed files with 11 additions and 2 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-github-actions': patch
---
Link to GitHub using host defined in app config if defined.
@@ -72,6 +72,8 @@ export const RecentWorkflowRunsCard = ({
}
}, [error, errorApi]);
const githubHost = hostname || 'github.com';
return !runs.length ? (
<EmptyState
missing="data"
@@ -81,7 +83,7 @@ export const RecentWorkflowRunsCard = ({
<Button
variant="contained"
color="primary"
href={`https://github.com/${owner}/${repo}/actions/new`}
href={`https://${githubHost}/${owner}/${repo}/actions/new`}
>
Create new Workflow
</Button>
@@ -191,6 +191,8 @@ export const WorkflowRunsTable = ({
branch,
});
const githubHost = hostname || 'github.com';
return !runs ? (
<EmptyState
missing="data"
@@ -200,7 +202,7 @@ export const WorkflowRunsTable = ({
<Button
variant="contained"
color="primary"
href={`https://github.com/${projectName}/actions/new`}
href={`https://${githubHost}/${projectName}/actions/new`}
>
Create new Workflow
</Button>