Skip to content
git-merge

GitHub Action

sync-branch-github-action

v1.1.1 Latest version

sync-branch-github-action

git-merge

sync-branch-github-action

Sync branch with GitHub Actions

Installation

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

              

- name: sync-branch-github-action

uses: remarkablemark/[email protected]

Learn more about this action in remarkablemark/sync-branch

Choose a version

sync-branch

version test License: MIT

🤖 Sync branch with GitHub Actions.

Note

To use this action, make sure to enable Settings > Actions > General > Workflow permissions:

  • Read and write permissions
  • Allow GitHub Actions to create and approve pull requests

Quick Start

Merge master to dev:

on:
  push:
    branches:
      - master
jobs:
  sync-branch:
    runs-on: ubuntu-latest
    steps:
      - name: Sync Branch
        uses: remarkablemark/sync-branch@v1
        with:
          base: dev

Usage

See action.yml

Basic:

- uses: remarkablemark/sync-branch@v1
  with:
    base: my-base-branch

Inputs

base

Required: The base branch.

- uses: remarkablemark/sync-branch@v1
  with:
    base: my-base-branch

head

Optional: The head branch. Defaults to the repository default branch (e.g., master or main).

- uses: remarkablemark/sync-branch@v1
  with:
    base: my-base-branch
    head: my-head-branch

merge

Optional: The merge method (merge, squash, rebase). Defaults to merge.

- uses: remarkablemark/sync-branch@v1
  with:
    base: my-base-branch
    merge: squash

title

Optional: The pull request title.

- uses: remarkablemark/sync-branch@v1
  with:
    base: my-base-branch
    title: My PR title

body

Optional: The pull request body.

- uses: remarkablemark/sync-branch@v1
  with:
    base: my-base-branch
    body: My PR body

delete-branch

Optional: Delete the local and remote branch after merge. Defaults to false.

- uses: remarkablemark/sync-branch@v1
  with:
    base: my-base-branch
    delete-branch: true

admin

Optional: Use administrator privileges to merge a pull request that does not meet requirements. Defaults to false.

- uses: remarkablemark/sync-branch@v1
  with:
    base: my-base-branch
    admin: true
    token: ${{ secrets.PAT }}

Note

The token input must be set for admin to work.

token

Optional: The GitHub token.

- uses: remarkablemark/sync-branch@v1
  with:
    base: my-base-branch
    token: ${{ secrets.GITHUB_TOKEN }}

Examples

Contributions

Contributions are welcome!

License

MIT