How to determine if a Jenkins build is triggered by a Pull Request merged to Master
You might try installing the GitHub Integration plugin. Reading their documentation, they provide a number of environment variables you can use for your purpose.


GITHUB_PR_STATE can be OPEN, CLOSE
GITHUB_PR_SOURCE_BRANCH for the source branch (e.g., hotfix/foo)
GITHUB_PR_TARGET_BRANCH or master


Using the when condition, you can run a job/stage when it's a closed PR merging into the master branch using:

when { 
  allOf { 
    expression { env.GITHUB_PR_STATE == "CLOSE" }
    expression { env.GITHUB_PR_TARGET_BRANCH == "master" }
    expression { env.GITHUB_PR_SOURCE_BRANCH == "hotfix/foo" }
  } 
}