创建拉动请求时,执行github操作以自动合并

发布于 2025-02-08 14:06:36 字数 138 浏览 3 评论 0原文

我正在为我的一些项目设置GitHub操作。我想实现的流程是:

  1. 开发人员打开了一个新的拉力请求
  2. 该分支自动与主分支合并

我的问题是,是否有可能实现此类工作流程?如果没有,其他可能的选择是什么?

I'm setting up Github actions for a few of my projects. The flow I'd like to achieve is:

  1. A developer opens a new pull request
  2. The branch is automatically merged with the main branch

My question is, is it possible to achieve this kind of workflow? If not, what are the other possible alternatives?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

影子的影子 2025-02-15 14:06:36

您可以使用 github Action“合并分支” ,例如任何>功能/XXX推开分支(您可以根据需要更改命名约定)。

name: Merge any release branch to uat
on:
  push:
    branches:
      - 'feature/*'
jobs:
  merge-branch:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3

      - name: Merge feature/xxx -> main
        uses: devmasx/merge-branch@master
        with:
          type: now
          target_branch: main
          github_token: ${{ github.token }}

You could use the GitHub Action "Merge branch", for instance for any feature/xxx branch pushed (you can change the naming convention as you want).

name: Merge any release branch to uat
on:
  push:
    branches:
      - 'feature/*'
jobs:
  merge-branch:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3

      - name: Merge feature/xxx -> main
        uses: devmasx/merge-branch@master
        with:
          type: now
          target_branch: main
          github_token: ${{ github.token }}

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文