(req: Request, res: Response, next: NextFunction)
| 103 | } |
| 104 | |
| 105 | export async function checkMainPushAction(req: Request, res: Response, next: NextFunction) { |
| 106 | // @see https://docs.github.com/en/webhooks/webhook-events-and-payloads#push |
| 107 | const action = req.headers?.['x-github-event'] |
| 108 | const { ref /*, repository, sender */ } = req.body |
| 109 | if (!(action === 'push' && ref === 'refs/heads/main')) { |
| 110 | return res.status(200).send(`Nothing to do for action ${action} on ref ${ref}`) |
| 111 | } |
| 112 | next() |
| 113 | } |