mirror of
https://github.com/github/codeql-action.git
synced 2025-12-27 09:40:17 +08:00
13 lines
341 B
JavaScript
13 lines
341 B
JavaScript
export async function * asyncEventIteratorFromApi(api) {
|
|
// TODO: support multiple runs (watch mode)
|
|
const {value: plan} = await api.events('run').next();
|
|
|
|
for await (const stateChange of plan.status.events('stateChange')) {
|
|
yield stateChange;
|
|
|
|
if (stateChange.type === 'end' || stateChange.type === 'interrupt') {
|
|
break;
|
|
}
|
|
}
|
|
}
|