Trigger pull_request from branch (HEAD_REF)

Hello,

I would want to trigger a pull_request on close event from a branch pattern - so having something like

on:
pull_request:
types: [closed]
origin:
- 'branch-pattern/**

The idea I have, but maybe I am not using the best approach, is to trigger a deploy action (on a Azure function in my case) when the artifact generated in a previous workflow and stored in a BUILDS folder under a specific branch name, is approved via PR.

This allows me to have a workflow to build my package - then it can be tested and checked, and another one to deploy the code.

Of course I can achieve this using “if” in my steps (as I have access to github.event.pull_request.head.ref), but that implies that the workflow runs when any PR is made on master - which in my case can occurs multiple time.

Thanks for your help

  • Julien