diff --git a/plugins/github-actions/src/components/Widget/Widget.tsx b/plugins/github-actions/src/components/Widget/Widget.tsx index 201004f46e..59e1cc5289 100644 --- a/plugins/github-actions/src/components/Widget/Widget.tsx +++ b/plugins/github-actions/src/components/Widget/Widget.tsx @@ -109,14 +109,13 @@ export const Widget = ({ ); }; -const WidgetListContent = ({ +const RecentWorkflowRunsCardContent = ({ error, loading, branch, }: { error?: Error; loading?: boolean; - lastRun: WorkflowRun; branch: string; }) => { if (error) return Couldn't fetch {branch} runs; @@ -124,7 +123,7 @@ const WidgetListContent = ({ return ; }; -export const WidgetList = ({ +export const RecentWorkflowRunsCard = ({ entity, branch = 'master', }: { @@ -135,13 +134,12 @@ export const WidgetList = ({ const [owner, repo] = ( entity?.metadata.annotations?.['backstage.io/github-actions-id'] ?? '/' ).split('/'); - const [{ runs, loading, error }] = useWorkflowRuns({ + const [{ loading, error }] = useWorkflowRuns({ owner, repo, branch, }); - const lastRun = runs?.[0] ?? ({} as WorkflowRun); useEffect(() => { if (error) { errorApi.post(error); @@ -150,11 +148,10 @@ export const WidgetList = ({ return ( - ); diff --git a/plugins/github-actions/src/components/Widget/index.ts b/plugins/github-actions/src/components/Widget/index.ts index 0efc84d952..0bd5dad98a 100644 --- a/plugins/github-actions/src/components/Widget/index.ts +++ b/plugins/github-actions/src/components/Widget/index.ts @@ -13,4 +13,4 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -export { Widget, WidgetList } from './Widget'; +export { Widget, RecentWorkflowRunsCard } from './Widget';