我想有一个github工作流合并主到我的分支名为开发后,公关合并。
推送到protected分支时出错-
remote: error: GH006: Protected branch update failed for refs/heads/develop.
remote: error: At least 1 approving review is required by reviewers with write access.
To https://github.com/blabla/blabla-repo
! [remote rejected] develop -> develop (protected branch hook declined)
error: failed to push some refs to 'https://github.com/blabla/blabla-repo'
Error: Process completed with exit code 1.
也许它没有使用管理员用户?我还添加了旁路选项..仍然得到错误..
name: Auto merge PR from main/master to develop branch
on:
pull_request:
branches:
- main
- master
types: closed
jobs:
merge-main-back-to-develop:
if: github.event.pull_request.merged == true
timeout-minutes: 2
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.adminUserToken }}
steps:
- uses: actions/checkout@v2
- name: Set Git config
run: |
git config --local user.email "temp@temp.com"
git config --local user.name "temp"
- name: Merge main back to develop
run: |
git fetch --unshallow
git checkout develop
git pull
git merge --no-ff ${{ github.base_ref }} -m "Auto-merge master/main back to develop"
git push --force
我已经尝试使用此选项添加用户,但它仍然不起作用。
1条答案
按热度按时间wydwbb8l1#
在
token
下使用正确的权限配置PAT, checkout 步骤如下:有关详细信息,请参阅用法。