Cursor Origin pull request trigger
See Cursor Origin Triggers for an overview and Event Triggers for generic options like title, target, and if.
Placing the following snippet at the top of an RWX file will result in all tasks in the file running any time a Cursor Origin pull request is opened, synchronized, or reopened.
on:
origin:
pull-request:
It's common to pass values from the event as init parameters into tasks.
on:
origin:
pull-request:
init:
commit-sha: ${{ event.git.sha }}
base:
image: ubuntu:24.04
config: rwx/base 1.1.1
tasks:
- key: code
call: git/clone 2.0.8
with:
repository: https://origin.cursor.com/YOUR_ORG/YOUR_REPO.git
ref: ${{ init.commit-sha }}
github-token: ${{ origin.token }}
Event fields
The following values are available in the event context for Cursor Origin pull request triggers:
| Path | Description |
|---|---|
event.git.sha | The SHA of the commit that triggered the event. |
event.git.branch | The branch of the pull request. |
event.git.ref | The ref of the pull request. |
event.origin.pull-request.event.payload.pullRequest.number | The pull request number |
event.origin.pull-request.event.payload.pullRequest.title | The title of the pull request. |
For all values available in the event.origin.pull-request context for Cursor Origin pull request triggers, see Cursor Origin's documentation on pull requests.
Actions
By default, RWX fires the pull request trigger on [created, head_ref.pushed, reopened]. If you only want to handle certain actions, you can specify them:
on:
origin:
pull-request:
actions: [closed]
Note that closed is not a default action, as most teams will instead use a
push trigger on the base branch after
a pull request is merged.
See Cursor Origin's documentation on events for a full list of available actions.