upsidr / merge-gatekeeper

Get better merge control
MIT License
85 stars 14 forks source link

Add Support for Merge Queues #71

Open Fitzbert-Fitz opened 1 year ago

Fitzbert-Fitz commented 1 year ago

We are happily using Merge-Gatekeeper in our github projects.

We are also looking into Github Merge Queues, which are GA since July. I played a little bit and triggered merge-gatekeeper for github.event_group and handing down the github ref. It kinda looked promising but It had some side affects. It stopped working for PRs. ;-).

But since you do not officially support merge queues I will not report a bug. Instead I would like to ask for that support? Or guidence how to configure merge-gatekeeper for merge queues if it support it by default?

rytswd commented 1 year ago

Hi @Fitzbert-Fitz, thanks for raising this! ☺️

I was aware of the merge queue support, but didn't think it would have any impact to Merge Gatekeeper 😅 We haven't made use of it at UPSIDER, and while we may not have an immediate need for it, we would certainly want to support it if feasible. Let us have a closer look from our side to see what would be needed to support it -- if you have any ideas or suggestions, we would love to hear as well 🥰

sinisastanic commented 11 months ago

I managed to workaround it like this:

---
name: Merge Gatekeeper

on:
  pull_request:
    branches:
      - main
  merge_group:

jobs:
  merge-gatekeeper:
    runs-on: ubuntu-latest
    permissions:
      checks: read
      statuses: read
    steps:
      - name: Run Merge Gatekeeper
        if: github.event_name != 'merge_group'
        uses: upsidr/merge-gatekeeper@v1
        with:
          token: ${{ secrets.GITHUB_TOKEN }}

      - name: Run Merge Gatekeeper in Merge Queue
        if: github.event_name == 'merge_group'
        uses: upsidr/merge-gatekeeper@v1
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          ref: ${{github.ref}}