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

I get error "protected branch hook declined" when I try to create a draft pull request into protected branch #2855

Open
MayaTaylorAccuity opened this issue Apr 12, 2024 · 1 comment

Comments

@MayaTaylorAccuity
Copy link

Subject of the issue

I would like to create a pull request that a developer has to review/approve online before the change gets merged in. However, I get error "protected branch hook declined" when I try to create a draft pull request into protected branch.

Steps to reproduce

I've tried various variations of this step., but I always get the error:

- name: Create Draft Pull Request
        id: create-pull-request
        env:
          NEW_VERSION: "test-version"
        uses: peter-evans/create-pull-request@v6
        with:
          token: ${{ github.token }}
          delete-branch: false
          labels: |
            automated pr
          commit-message: "Update main branch to ${{ env.NEW_VERSION }}"
          title: "Update main branch to ${{ env.NEW_VERSION }}"
          body: "$NEW_VERSION version update of main branch from int"
          branch: "main_for_rule_tests"
          draft: true
@peter-evans
Copy link
Owner

Hi @MayaTaylorAccuity

The branch input should not be your existing branch that you want to merge into, it should be the name of the pull request branch that the action will create. I think that is probably what the issue is.

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

2 participants