Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
refresh-cw

GitHub Action

Sync Branch

v1.0.0

Sync Branch

refresh-cw

Sync Branch

Keep a branch in sync with the current branch

Installation

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

              

- name: Sync Branch

uses: connor-baer/[email protected]

Learn more about this action in connor-baer/action-sync-branch

Choose a version

Sync Branch

GitHub Action to keep a branch in sync with the current branch

Inputs

branch

Required The name of the branch to sync with the current branch.

token

Required A GitHub token with permission to push to the repo. Generate a new token.

force

Whether to force the update or to make sure the update is a fast-forward update. Leaving this out or setting it to false will make sure you're not overwriting work. Default: false.

Usage

Here's an example workflow that syncs a test branch every time a commit is pushed to the main branch:

name: Sync branch

on:
  push:
    - main

jobs:
  sync-branch:
    name: Update test branch
    runs-on: ubuntu-latest
    steps:
    - name: Checkout repository
      uses: actions/checkout@master
    - uses: connor-baer/action-sync-branch@v1
      with:
        branch: test
        token: ${{ secrets.GITHUB_TOKEN }}
        force: false