【问题标题】:Use github-actions as an user for automated pull requests将 github-actions 用作自动拉取请求的用户
【发布时间】:2022-10-24 15:03:35
【问题描述】:

我注意到我在开源项目中实现的自动拉取请求将管理员作为拉取请求之一。理想情况下,如果它是由机器人打开的,那么 github-actions 应该是打开拉取请求的人。

这使操作对每个人都更加透明。我还没有想出如何改变它。

【问题讨论】:

    标签: github bots github-actions pull-request


    【解决方案1】:

    我建议使用create-pull-request 操作。这是一个例子:

    jobs:
      createPullRequest:
        runs-on: ubuntu-latest
        steps:
          - uses: actions/checkout@v3
    
          - name: Make changes to pull request
            run: date +%s > report.txt
    
          - name: Create Pull Request
            id: cpr
            uses: peter-evans/create-pull-request@v4
            with:
              token: ${{ secrets.PAT }}
              commit-message: Update report
              committer: GitHub <noreply@github.com>
              author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
              signoff: false
              branch: example-patches
              delete-branch: true
              title: '[Example] Update report'
              body: |
                Update report
                - Updated with *today's* date
                - Auto-generated by [create-pull-request][1]
    
                [1]: https://github.com/peter-evans/create-pull-request
              labels: |
                report
                automated pr
              assignees: peter-evans
              reviewers: peter-evans
              team-reviewers: |
                owners
                maintainers
              milestone: 1
              draft: false
    

    这是一个演示:

    【讨论】:

      猜你喜欢
      • 2019-12-21
      • 2021-09-25
      • 2023-03-24
      • 2020-08-10
      • 2022-08-16
      • 1970-01-01
      • 2020-03-23
      • 1970-01-01
      • 2021-10-17
      相关资源
      最近更新 更多