Replies: 5 comments 5 replies
-
Having exactly the same problem. We want to have end-to-end testing only triggered when a PR is ready to be merged into the main branch and not before. After all PR checks succeeded and resolved all the PR comments when I click green |
Beta Was this translation helpful? Give feedback.
-
I have nothing to add, just that this would be a really valuable feature for my team. The use case:
|
Beta Was this translation helpful? Give feedback.
-
This would be a very valuable feature for us as well ; the use case is like that of the original author. The job performs a deployment, and we would like this job to run only when someone submits a PR for merge to Although I am going to try some of the workarounds mentioned, I still think it would be great to have a clean solution ! |
Beta Was this translation helpful? Give feedback.
-
One way that works for me is:
|
Beta Was this translation helpful? Give feedback.
-
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
Beta Was this translation helpful? Give feedback.
-
Select Topic Area
Question
Body
I have a job that performs a deployment. That deployment mutates infrastructure, so it is critical that:
a. if that succeeds, the PR merges.
b. if it doesn't, the changes get reverted, and the PR stays open.
It seemed to me that the right way to fulfill point 3 was to force the use of a merge queue. The idea is that the job would run when the PR enters a merge group, and if it succeeds, it would get merged, while if it did not succeed, it would get dequeued from the merge queue.
However, this just doesn't seem to be working.
Attempt one: just using the obvious
on: merge_group
:This doesn't work. When pressing "Merge when Ready", the PR gets added to the merge queue, waits a bit, then promptly merges the result without running the job.
Attempt 2: adding pull_request on top of that
All examples seem to specify both
on: pull_request
andon: merge_group
; OK, but due to point 2 I don't want to apply the changes during the pull request checks, so I'll just make sure it just targets theenqueued
type.That sure didn't work. Just like attempt 1, the PR gets added to the merge queue, no new job runs, and it gets merged almost immediately.
Attempt 3: maybe pull_request needs to be there for qualification?
Okay, maybe the
pull_request
job needs to physically exist and run on the pull request in order for it to rerun on the merge_group. Maybe I can just skip the job if it's not the enqueued action? That probably works better since I'm not seeingenqueued
being part of the activity type list forpull_request
, but I do see it for the webhook payload value underaction
, which should be accessible under thegithub.event
context.Nope. Still not working with the same symptoms as attempts 1 and 2, except that now job appears skipped on the pull request but doesn't trigger when the pull request gets enqueued.
#26724 vaguely mentions that merge queues are supposed to be solving this use-case but it clearly doesn't as far as I can tell. Am I missing something here?
Beta Was this translation helpful? Give feedback.
All reactions