Showing results for 
Search instead for 
Did you mean: 
Copilot Lvl 2
Message 1 of 2

Run actions on Pull Requests with merge conflicts

Solved! Go to Solution.

We have a suite of actions which allows us to build and deploy mobile apps archives from pull requests, which we use as a part of our release process and planned to use for feature development.


Workflow has been configured like this:


    types: [labeled]

if: startsWith(github.head_ref, 'release/') && == 'deploy_ios'
- ...



We have recently started to encounter problems, that actions do not start at all, if PR has any conflicts with a base branch. This is a rather interesting limitation for our use case, our current gitflow assumes possible existance of merge conflict between release/ and master branches (we cherry pick hotfixes), where in the end we would occasionally override master branch with changes from release with strategy-option (this happens because of previous release hotfixes having different parent commits).


For feature branches it's also rather an undesired behaviour, since if I want to share a test build with my colleagues (designer, pm) to test, we don't really care whether I'm up to date with base branch. 


In fact checkout action already allows to disable merging into base, which we use, but it doesn't really work if you workflow doesn't get trigged at all.

      - uses: actions/checkout@v1
          ref: ${{ github.head_ref }}


There have been some other related threads, which didn't got much attention in the end:


Suggested approach with using on: push, doesn't really work with labels. We know for sure that we can work it out with on: issue_comment, but it's cumbersome and requires an extra API call to get PR context.


What would be really nice is an option in repo settings to allow run actions with merge conflicts. Or if there's any alternative solution to configure a workflow run without looking at a conflicts and ideally with a context of a PR, would be great to know.


Thank you!

1 Reply
GitHub Partner
Message 2 of 2

Re: Run actions on Pull Requests with merge conflicts

Thank you for reaching out! It’s a limitation that workflow is not triggered for ‘pull_request’ event if conflicts exist.

BTW,  please set ‘if’ expression at step level and ‘startswith()’ doesn’t accept variables, please use code sample as below:

      - if: github.head_ref == 'release' && == 'deploy_ios'
        uses: actions/checkout@v1