Skip to content

Commit 6591b60

Browse files
authored
Prevent error in purge old workflow runs workflow (#55313)
1 parent 746bdff commit 6591b60

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/workflows/purge-old-workflow-runs.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,11 +155,11 @@ async function deleteWorkflowRuns(
155155
created: minCreatedSearch,
156156
},
157157
)
158-
const runs = data.workflow_runs
158+
const runs = data.workflow_runs || []
159159
console.log(
160160
`Total runs in workflow "${
161161
workflow.name
162-
}" (${minCreatedSearch}): ${data.total_count.toLocaleString()}`,
162+
}" (${minCreatedSearch}): ${(data.total_count || 0).toLocaleString()}`,
163163
)
164164

165165
let deletions = 0

0 commit comments

Comments
 (0)