mirror of
https://github.com/github/codeql-action.git
synced 2025-12-30 19:20:08 +08:00
17 lines
415 B
JavaScript
17 lines
415 B
JavaScript
async function emitEvent(state, context) {
|
|
const { name, action } = context;
|
|
if (state.eventHandlers[`${name}.${action}`]) {
|
|
for (const eventHandler of state.eventHandlers[`${name}.${action}`]) {
|
|
await eventHandler(context);
|
|
}
|
|
}
|
|
if (state.eventHandlers[name]) {
|
|
for (const eventHandler of state.eventHandlers[name]) {
|
|
await eventHandler(context);
|
|
}
|
|
}
|
|
}
|
|
export {
|
|
emitEvent
|
|
};
|