Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail to sync when target branch has Branch protection rule #76

Open
maze88 opened this issue Jul 10, 2024 · 0 comments
Open

Fail to sync when target branch has Branch protection rule #76

maze88 opened this issue Jul 10, 2024 · 0 comments

Comments

@maze88
Copy link

maze88 commented Jul 10, 2024

Overview

With a target_sync_branch that has a Branch protection rule configured and with target_branch_push_args: --force, I receive the following error:

Pushing synced data to target branch.
remote: error: GH006: Protected branch update failed for refs/heads/my-target-branch.        
remote: error: Changes must be made through a pull request.

Expected behavior

For the sync to occur successfully, even though the target branch is protected.

Additional details

  • The Branch protection rule is configured to:
    • Require a pull request before merging (with Require approvals=1).
    • Allow force pushes (by Everyone).
  • Here is the step from my workflow (with some substitutions for clarity):
    steps:
    - name: Checkout target repo
      uses: actions/checkout@v3
      with:
        ref: ${{ matrix.branch }}  # master & our release branch
    - uses: aormsby/[email protected]
      with:
        git_config_user: my-ci-cd
        git_config_email: [email protected]
        upstream_sync_repo: the-upstream-owner/${{ github.event.repository.name }}
        upstream_sync_branch: master
        target_repo_token: ${{ secrets.GITHUB_TOKEN }}
        target_sync_branch: ${{ matrix.branch }}
        target_branch_push_args: --force

Conclusion

There is the possibility that this is user error - that I'm missing some setting or input in the action or branch rule settings - if so then I'd be very happy for some guidance...!
Otherwise, a feature to support such a case may be desired by more users...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant