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

Add Support for Merge Queues #71

Open
Fitzbert-Fitz opened this issue Jul 18, 2023 · 2 comments
Open

Add Support for Merge Queues #71

Fitzbert-Fitz opened this issue Jul 18, 2023 · 2 comments

Comments

@Fitzbert-Fitz
Copy link

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
Copy link
Member

rytswd commented Jul 18, 2023

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
Copy link

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}}

github-merge-queue bot pushed a commit to Lendable/composer-license-checker that referenced this issue Mar 2, 2024
`github.ref` breaks PRs, but works for merge queues, make it
conditional.

See upsidr/merge-gatekeeper#71

---------

Co-authored-by: Marcin Michalski <marcin+github@michalski.dev>
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

No branches or pull requests

3 participants