Skip to content

Make only-new-issues work with Merge Queues, not just Pull Requests #956

@andrewedstrom

Description

@andrewedstrom

Welcome

  • Yes, I understand that the GitHub action repository is not the repository of golangci-lint itself.
  • Yes, I've searched similar issues on GitHub and didn't find any.

Your feature request related to a problem? Please describe.

only-new-issues is fantastic, but it currently only works when the GitHub event_name is pull_request. Please add support for the merge_group event name, so that this feature can work with merge queues as well.

Merge queues are a powerful feature of GitHub for teams that merge many pull requests per day. It lets you queue up multiple pull requests to be merged in a row. Adding a PR to the queue triggers a new run of the status checks, and once the required status checks pass, that PR is merged.

Describe the solution you'd like.

We just need only-new-issues to apply when the GitHub event is merge_group. Insrc/run.ts we would change this:

const ctx = github.context
  if (ctx.eventName !== `pull_request`) {
    core.info(`Not fetching patch for showing only new issues because it's not a pull request context: event name is ${ctx.eventName}`)
    return ``
  }

to this:

const ctx = github.context;
if (ctx.eventName !== `pull_request` && ctx.eventName !== `merge_group`) {
  core.info(`Not fetching patch for showing only new issues because it's not a pull request or merge group context: event name is ${ctx.eventName}`);
  return ``;
}

(I'm assuming there would need to be some additional changes to figure out the patch, but nothing too bad)

Describe alternatives you've considered.

My main alternatives are

  1. Fix all linter errors in my project at once (hard)
  2. Disable the linter as a required check.

Additional context.

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions