GitHub Action PR工作流程开发常规
我正在研究仅由pull_request
事件触发的GitHub操作。 想知道是否有比我目前正在做的更好的“开发经验”。
我的理解是,工作流文件必须位于base
分支中。因此,为了测试工作流程更改,我必须将代码推到基本分支,然后通过头部分支触发工作流程。
假设我已经有my-base
和my-head
分支,并设置了拉请请求。我通过syncronization
事件触发工作流程,通过推入头部分支:
git checkout my-base
git add . && git commit -m "plx work" && git push
git checkout my-head
git merge my-base --no-edit && git push
有更好的方法吗?
I'm working on GitHub actions that only get triggered by pull_request
events.
Wondering if there is a better "dev experience" than what I'm currently doing.
My understanding is that the workflow file must be in the base
branch. So in order to test workflow changes, I gotta push code to the base branch, then trigger the workflow via the head branch.
Assume I've already got my-base
and my-head
branches, with a pull request set up. I trigger the workflow via syncronization
events, by pushing to the head branch:
git checkout my-base
git add . && git commit -m "plx work" && git push
git checkout my-head
git merge my-base --no-edit && git push
Is there a better way?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于触发
pull_request
而言,这是不正确的。这足以让此触发器与您的拉请请求相关联的分支 - 无需将其放入基本分支。pull_request_target
需要在基本分支中才能命名一个示例。 -That's not true for the trigger
pull_request
. It is enough for this trigger to be on the branch associated with your pull request -- no need to put it in the base branch.pull_request_target
, however, needs to be in the base branch to name an example. –