Create release trigger from merged pull request commits
When a pull request is merged, its commit is passed to your sub-zap with the commit link, message, author and repository, so release steps start without anyone copying details.
Install it
Set up this Zap for me, read how here: https://zapier.sh/zapier/awesome-zaps/create-release-trigger-from-merged-pull-request-commits/
Paste into Claude, ChatGPT, Cursor or any agent.
- Category
- Engineering · Software delivery
- Author
- Zapier
- Source
- zapier/awesome-zaps, folder zaps/create-release-trigger-from-merged-pull-request-commits
Set it up with the CLI
- Add it. Copies the folder into
zaps/create-release-trigger-from-merged-pull-request-commits/. Outside a project, it makes one first.npx zap-pack add awesome-zaps/create-release-trigger-from-merged-pull-request-commits - Fill in the values in
config.ts, and in any other file the list marks. Replace each one as its comment and SKILL.md say. - Deploy it. Asks for any value still left, signs you in to Zapier if you aren't, then publishes it to your account.
npx zap-pack deploy create-release-trigger-from-merged-pull-request-commits - Check it. Its recent runs, with status and errors.
npx zap-pack logs create-release-trigger-from-merged-pull-request-commits
zaps/create-release-trigger-from-merged-pull-request-commits/
- README.mdWhat it does, for people
- SKILL.mdHow an agent sets it up: what to ask you, and how to test it
- config.tsIts settings 2 to fill in
- connections/github.tsThe
githubaccount it uses - triggers/commit.tsWhat starts it:
githubcommit1 to fill in - workflow.tsThe code; each
ctx.stepis a step in the Zap
Agents: add --yes to any command so it never prompts. When it needs an answer only the user can give, it stops and names the flag that supplies it.
SKILL.md
View MarkdownWhat it does
- Trigger: a new commit lands on the watched GitHub repository (
github,commit). - Filter: the commit message must start with
Merge pull request #<number>. Other commits end the run asskipped. - Repository: the
owner/repois read from the commit's HTML URL. - Sub-zap: a JSON POST goes to your sub-zap webhook with
url,message,authorandrepo.
The Zap only reads commits and posts them to the sub-zap; it never writes to GitHub.
Ask the user
Each REPLACE_… value is set per person. Resolve the repository to its owner/repo with the user's GitHub connection; don't ask them to paste an ID you can look up.
| Setting | Where | What goes there |
|---|---|---|
REPLACE_GITHUB_REPO |
config.ts (GITHUB_REPO) and triggers/commit.ts, repo |
The repository to watch, as owner/repo. Both places get the same answer. |
REPLACE_SUB_ZAP_URL |
config.ts (SUB_ZAP_URL) |
The sub-zap's webhook URL. It must accept JSON with url, message, author and repo. |
Also review the default with them: MERGE_PATTERN in workflow.ts matches GitHub's standard merge message. Ask whether the team squashes or rebases pull requests; if so, that message won't match and the pattern needs changing.
Build it
If you can run shell commands, set it up with zap-pack: run npx zap-pack add awesome-zaps/create-release-trigger-from-merged-pull-request-commits, replace each REPLACE_… value as this file says, then run npx zap-pack deploy create-release-trigger-from-merged-pull-request-commits, which signs the user in to Zapier when it gets there. Otherwise build with Zapier MCP, as the steps below say. No Zapier MCP tools? Read https://docs.zapier.com/mcp/get-started/quickstart.md and follow the page for the app you are running in to get the user connected, then continue with this build.
- Accounts: bind
github(the trigger's connection, intriggers/commit.ts) to the user's GitHub connection for the account that can read the repository. Webhooks by Zapier needs no connection. - Source: publish
workflow.tsandconfig.ts, with eachREPLACE_…replaced by the user's answer.triggers/commit.tsandconnections/are settings, not code: set the workflow's trigger and connection bindings from them. The trigger file names the app by its slug; for the trigger'sselected_api, callsearch_triggerswith that slug, find the row whosekeyis the trigger'sevent, and use<app_key>@<app_version>from it. - Build guide: load Zapier's build guide with
get_zapier_skill("zapier:build-workflows")and follow it to create, test and publish the workflow. - Fields: inspect each action's fields with the user's connections (and sample the trigger) before the first test run, and fix any key in
workflow.tsthat doesn't match.
Test it
Run this sample as a draft test run before publishing. It is a non-merge commit, so it should skip without calling anything:
{
"html_url": "https://github.com/acme/widgets/commit/abc123",
"message": "Fix typo in README",
"author_login": "octocat"
}
Confirm the output is { "skipped": true, "reason": "not-a-merged-pull-request" }. Then run a merged-PR sample, such as a commit message Merge pull request #42 from acme/fix-typo, with a sub-zap URL you control. Check that the sub-zap receives url, message, author and repo. If run-status tools aren't available, check the sub-zap's run history directly. Ask the user to delete any test runs in the sub-zap; the agent doesn't delete test data. Then publish, confirm the trigger is active, and give the user their webhook details.
Notes
- The sub-zap is a plain webhook POST, not a Sub-Zap step, so the receiving end must accept JSON.
- A merged pull request whose commit message was edited may not match the pattern.
- Anyone with the sub-zap URL can post to it. Keep it out of shared documents.
- To route to different sub-zaps by repository, or to add the PR number or branch name to the payload, change
workflow.ts.