Skip to content

Commit a45333c

Browse files
committed
Fix workflow type in pinnedWorkflows
1 parent 136db00 commit a45333c

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

src/model.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ type RepoData<T extends keyof Octokit["repos"]> = RepoResponse<T>["data"];
1111
// Domain contracts
1212
//
1313

14+
export type Workflow = ActionData<"listRepoWorkflows">["workflows"][number];
1415
export type WorkflowRun = ActionData<"getWorkflowRun">;
1516
export type WorkflowRunAttempt = ActionData<"getWorkflowRunAttempt">;
1617
export type WorkflowJob = ActionData<"getJobForWorkflowRun">;

src/pinnedWorkflows/pinnedWorkflows.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,13 @@ async function updatePinnedWorkflows() {
110110
}
111111

112112
// Get all workflows to resolve names. We could do this locally, but for now, let's make the API call.
113-
const workflows = await gitHubRepoContext.client.paginate(gitHubRepoContext.client.actions.listRepoWorkflows, {
113+
const workflows: Workflow[] = await gitHubRepoContext.client.paginate(gitHubRepoContext.client.actions.listRepoWorkflows, {
114114
owner: gitHubRepoContext.owner,
115115
repo: gitHubRepoContext.name,
116116
per_page: 100
117117
});
118118

119-
const workflowByPath: {[id: string]: Workflow} = {};
119+
const workflowByPath: Record<string, Workflow> = {};
120120
workflows.forEach(w => (workflowByPath[w.path] = w));
121121

122122
await Promise.all(

0 commit comments

Comments
 (0)