Start a deploy when a pull request merges
When a task's pull request merges, a webhook can tell your deploy system straight away, so the change goes out without anyone pressing a button. A small receiver of yours gets the event, checks it came from Jaah, and starts the deploy for that project and commit. How endpoints, events and deliveries work is in How webhooks work.
You need to be an Owner or Admin of your organization, on a plan that includes webhooks, and a receiver at a
public https:// address that can start a deploy.
-
Open Settings, select Integrations, then Webhooks, and select New webhook.
-
Enter a Name that says where the events go, such as
Deploy on merge, and the URL of your receiver. -
Under Events, tick Pull request merged and leave everything else clear, so the receiver only hears about merges.

-
Under Projects, clear All projects and tick only the projects this receiver deploys. With All projects kept, a project added later would start sending merges to it too.
-
Select Create, and copy the signing secret into your receiver's configuration. Jaah shows it only once.
-
Have your receiver, for each delivery:
- check the signature first, as in Verify the signature, and refuse a delivery that fails it;
- skip a delivery it has already handled, since a delivery can arrive more than once;
- read the project's name and the pull request's
merge_shafrom the body, shown in What a delivery looks like, and start the deploy of that commit; - answer with a
2xxstatus within 10 seconds, and run the deploy after it answers. A deploy takes longer than that, and a slow answer counts as a failed attempt, which Jaah sends again.
-
Open the endpoint and select Send test. Its Deliveries tab shows the
pingas Delivered once your receiver answers. Apingnames no project or pull request, so your receiver should answer it without deploying. -
After the next merge, check the Deliveries tab. If a delivery failed, fix the receiver and select Redeliver on its row; Fix a failing webhook shows how to read why it failed.
Only pull requests that a task opened send this event: one your team opened by hand sends nothing, so keep
your usual deploy for those. Deliveries can also arrive out of order: when two merges land close
together, use each body's created_at so an older commit never replaces a newer one.
Related
- Receive events with webhooks: the delivery body, its headers, retries and the delivery log.
- Change which events a webhook sends: add a project to the receiver later.
- Pause a webhook: stop deploys while your receiver is down.
- Event catalog: every event a webhook can send.