admin管理员组文章数量:1122832
There's this unanswered GitHub communities discussion about GitHub Actions pull_request
events not being triggered when there are conflicts with the base branch set in the PR.
The GitHub Actions team hasn't suggested a real solution to this issue for more than 5 years now.
I have GitHub Action that creates a Docker image and pushes it to an ECR repository. This is the scenario when the issue occurs:
I--J <-- feature/first_branch (HEAD)
/
...--F--G--H--Z <-- master
Commits J
and Z
are conflicted, and now the pull_request
event in my GitHub Action won't be triggered since there's a conflict.
I know that push
events don't have this issue, but I must use a pull_request
event because I need to know what's the current branch's base branch because I cache-from
the base branch's latest
image.
I have a hack that works for me - I create another branch (feature/second_branch
) that's based on feature/first_branch
. Then I make a random commit that has no meaning so there'll be a diff between feature/second_branch
and feature/first_branch
(as GitHub doesn't allow opening PRs when there's no diff between the 2 branches you compare).
K--M <-- feature/second_branch (HEAD)
/
I--J <-- feature/first_branch
/
...--F--G--H--Z <-- master
Once I open a PR where feature/first_branch
is the base - I manage to trigger a pull_request
event have a branch with the code I want and isn't conflicted with its base branch.
That way there're no conflicts between them and I get my Docker image.
The problem with this hack is that I have no image to cache-from when feature/first_branch
has no latest
image pushed to the ECR (which is basically similar to triggering a push
event in first place).
This issue doesn't happen on CircleCI flows, but I can't migrate this flow from GitHub Actions at the moment.
Is there a way to overcome this issue without any hacks, or at least a simpler hack than mine?
本文标签:
版权声明:本文标题:git - Is there a proper way to run a GitHub Action pull_request event when there are conflicts with the base branch? - Stack Ove 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736310150a1934274.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论