Support merge queue#255
Conversation
|
In the meantime, we are trying this setup for merge queues: - name: Find Changes
uses: dorny/paths-filter@v3
id: find_changes
with:
# For merge group events, compare against the target branch (main)
base: ${{ github.event_name == 'merge_group' && github.event.merge_group.base_ref || '' }}
# For merge group events, use the merge group head ref
ref: ${{ github.event_name == 'merge_group' && github.event.merge_group.head_sha || github.ref }} |
Co-authored-by: Masaru Iritani <25241373+masaru-iritani@users.noreply.github.com>
|
@masaru-iritani lgtm. We should add this. Do you want to commit the build? |
… related functions
|
@saschabratton Thank you for taking a look! I realized my previous suggestion to match the type of pull request-related events wasn’t quite right. I pushed another commit that corrects it by keeping the existing behavior and updating the type annotation. If it looks good to you, I’d appreciate it if you could merge this pull request. |
|
@masaru-iritani I think it's fine either way. It's only referencing You just need to build the dist and we can merge this 👍🏻 |
|
@saschabratton I executed |
I'll publish this pull request once confirmed it's good to go by maintainers.
What
This pull request adds a support for
merge_groupevent.Why
Closes #183
Closes #253
Some repositories (including my organization's one) enable the merge queue, where pull requests are queued to be checked sequentially. It's common (I believe) to use the same test workflow for both
pull_requestevent andmerge_groupevent, which is triggered when a change gets into or out of the merge queue.Currently,
paths-filteraction doesn't do anything special for detecting the base commit for a commit in the merge queue. Therefore, if the merge queue has multiple pull requests, the diff may include changes from other pull requests and cause false-positives.Specifying the
baseandrefexplicitly from themerge_groupevent (as shown in #183) can workaround the problem. But it'd be great ifpaths-filtercan handle them by default.This change won't break existing workflows already specifying
refandbaseexplicitly because manual inputs take precedence over commit hashes from the event (unlikepull_requestevents where manual inputs are ignored).