Skip to content

Joao208/resync-branch

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

ReSync Branch

Quality Gate Status codecov Bump Version Test Action Unit Tests

This action will rebase/resync/reset your branch equal your default branch (main/master...)

🚨 For run correctly is needed PERSONAL_TOKEN, BRANCH_NAME and DEFAULT_BRANCH 🚨

You can run this action every time you create a new branch, synchronize or push to main

name: Automatic Rebase

on:
  push:
    branches:
      - main
  pull_request:
    types: [opened, synchronize, reopened]
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: ReSync Branch
        uses: Joao208/resync-branch@1.5.0
        with:
          PERSONAL_TOKEN: ${{secrets.PERSONAL_TOKEN}}
          BRANCH_NAME: development
          DEFAULT_BRANCH: ${{github.event.repository.default_branch}}

or scheduled, in this example we will run every friday at 17:00

name: Automatic Rebase

on:
  schedule:
    - cron: '0 17 * * 5'
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: ReSync Branch
        uses: Joao208/resync-branch@1.5.0
        with:
          PERSONAL_TOKEN: ${{secrets.PERSONAL_TOKEN}}
          BRANCH_NAME: development
          DEFAULT_BRANCH: ${{github.event.repository.default_branch}}