If pr X merges, automatically merges Y?

Imagine you are done working on your pull request Y, it has been reviewed, CI is green, everything is fine, but you still can’t merge it because X wasn’t merged yet and they are dependent.
Would you be interested by something that would automagically merges Y when X merges so you don’t have to worry about Y again ?

There is an action which could merge specific PR. You need to specify the PR number of Y in a workflow which could be triggered when X merged.

name: automerge
on: 
  pull_request: 
    types: [closed]
    branches: 
      - master
jobs:
  automerge:
    if: github.pull_request.merged == 'true'
    runs-on: ubuntu-latest

    steps:
    - name: Merge Pull Request
      uses: juliangruber/merge-pull-request-action@v1
      with:
        github-token: ${{ secrets.GITHUB_TOKEN }}
        number: 21
        method: squash