Run an action on every open pull request when a pull request is merged

As title, looking to have a specific sequents of events happen on every open PR whenever a PR is merged.

Have a fairly unusual repository setup where a js bundle for a component of the project is version controlled (why is outside of the scope of this discussion), looking to automatically rebase and rebuild (if possible) on open prs that modify js files. Getting a workflow to do that isn’t very hard but I need a way to get this to trigger on every open PR.

I probably am going to need to write a more complex action triggered by a workflow on PR merge, but it would be simpler if this could all be done in workflow.

When one pull request is merged, it will trigger an on: pull_request workflow with GITHUB_REF ‘refs/pull/: prNumber /merge’. It can not impact other opened PRs. If a PR has nothing changed, it can’t trigger a workflow. .

So I am afraid that your requirement can not be done in workflow.