lfkwtz / sync-branches

GitHub Action to sync back a branch to another after a merge.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

sync-branches

GitHub Action to sync one branch when another is updated.

Inputs

GITHUB_TOKEN

Required The token to be used for creating the pull request. Can be set to the one given for the workflow or another user.

FROM_BRANCH

Required The branch you want to make the pull request from.

TO_BRANCH

Required The branch you want to make the pull request to.

PULL_REQUEST_TITLE

What you would like as the title of the pull request.

Default: sync: {FROM_BRANCH} to {TO_BRANCH}

PULL_REQUEST_BODY

What you would like in the body of the pull request.

Default: sync-branches: New code has just landed in {FROM_BRANCH} so let's bring {TO_BRANCH} up to speed!

Outputs

PULL_REQUEST_URL

Set to the URL of either the pull request that was opened by this action or the one that was found to already be open between the two branches.

Example usage

name: Sync
on:
  push:
    branches:
      - master

jobs:
  sync-branches:
    runs-on: ubuntu-latest
    name: Syncing branches
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: Set up Node
        uses: actions/setup-node@v1
        with:
          node-version: 12
      - name: Opening pull request
        id: pull
        uses: tretuna/sync-branches@1.1.0
        with:
          GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
          FROM_BRANCH: "master"
          TO_BRANCH: "develop"

About

GitHub Action to sync back a branch to another after a merge.

License:MIT License


Languages

Language:JavaScript 100.0%