Skip to content
git-pull-request

GitHub Action

Change Pull Request Base

v1 Latest version

Change Pull Request Base

git-pull-request

Change Pull Request Base

Change the Pull Request Base Branch

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Change Pull Request Base

uses: Surnet/change-pr-base@v1

Learn more about this action in Surnet/change-pr-base

Choose a version

Deprecated

Please use the GitHub CLI for this use case.

- name: Change Base of PR
  run: |
    gh pr edit $PR_NUMBER --repo $REPO --base $BASE_BRANCH
  env:
    REPO: Owner/Repository
    PR_NUMBER: 11
    BASE_BRANCH: new-base-branch
    GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

change-pr-base

This action changes the Pull Request's base branch.

Inputs

repo

Required The repository name with syntax Owner/Repository

pull-number

Required Number of the pull request to change

new-base

Required The name of the branch that shall be changed

token

Required GitHub Token

Example usage

name: Change Base of PR
uses: Surnet/[email protected]
with:
  repo: Owner/Repository
  pull-number: 11
  new-base: new-base-branch
  token: ${{ secrets.GITHUB_TOKEN }}