Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support merge queue #255

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

masaru-iritani
Copy link

I'll publish this pull request once confirmed it's good to go by maintainers.

What

This pull request adds a support for merge_group event.

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_request event and merge_group event, which is triggered when a change gets into or out of the merge queue.

Currently, paths-filter action 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 base and ref explicitly from the merge_group event (as shown in #183) can workaround the problem. But it'd be great if paths-filter can handle them by default.

This change won't break existing workflows already specifying ref and base explicitly because manual inputs take precedence over commit hashes from the event (unlike pull_request events where manual inputs are ignored).

@masaru-iritani masaru-iritani changed the title Detect commit hashes from merge_group event Support merge queue Dec 18, 2024
if (base) {
core.warning(`'base' input parameter is ignored when action is triggered by pull request event`)
}
const pr = github.context.payload.pull_request as PullRequestEvent
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it may not be working currently...?

Suggested change
const pr = github.context.payload.pull_request as PullRequestEvent
const pr = github.context.payload as PullRequestEvent

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to use alongside github merge queues Document usage in a merge queue
1 participant