Skip to content

Commit

Permalink
feat: Validate event (#347)
Browse files Browse the repository at this point in the history
  • Loading branch information
peaceiris authored Dec 7, 2020
1 parent d3209d9 commit 9288798
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,16 @@ export async function run(): Promise<void> {
groupConsoleLog('Dump GitHub context', context, core.isDebug());

const eventName: string = context.eventName;
core.info(`[INFO] event name: ${eventName}`);
if (
eventName !== 'issues' &&
eventName !== 'pull_request' &&
eventName !== 'pull_request_target'
) {
core.info(`[INFO] unsupported event: ${eventName}`);
return;
}

const payload = context.payload as
| EventPayloads.WebhookPayloadIssues
| EventPayloads.WebhookPayloadPullRequest;
Expand Down

0 comments on commit 9288798

Please sign in to comment.