Currently you can set triggers in automations for “PR opened” and “PR pushed” - is it possible to put a option here to enable the trigger to run when the PR is in a draft state or not?
hey @bitttttten, thanks for your message, it seems like Automations already treat draft vs ready as separate triggers, as you can see in the attached screenshot, Draft opened actually runs when a draft PR is created, for further info, you can check Automations | Cursor Docs it’s the first element of the list!
Hey, Tom pointed you in the right direction. For drafts there’s a separate trigger called Draft opened, and it only fires when a draft PR is opened.
Current PR trigger behavior:
PR opened fires only for non-draft PRs, drafts are skipped
Draft opened fires only for draft PRs
PR pushed fires on pushes to any PR, including drafts
So instead of one trigger with a toggle, you use two separate triggers. If you need both cases, draft and non-draft, you can add two triggers to the same automation.
If you need a case the current triggers don’t cover, for example fire when a PR moves from draft to ready, tell me your exact use case and I’ll pass it to the team as feedback.
Thanks gang for the replies! That is clear, and that the behaviour is there is great.
You mention “PR opened fires only for non-draft PRs, drafts are skipped” - although this was not true for us.. I’ll keep an eye on it although we definitely had automations run on draft PRs last week.
Glad to hear that this is what is intended already. So what I’ll do is report back if I see it happening again, then I can share some automation IDs and run/agent IDs with ya.
About PR opened triggering on a draft PR, it’s supposed to skip draft PRs by design. So if that really happened, that’s an interesting case and I’d like to dig into it.
If it happens again, please send:
the automation ID
the run ID or agent ID for that run
an approximate timestamp
Also, please double-check which trigger was set on that automation, PR opened vs PR pushed vs Draft opened. PR pushed triggers on draft PRs by default, so I want to rule out any confusion.
With that info, we can take a deeper look. Thanks!