sync-branches icon indicating copy to clipboard operation
sync-branches copied to clipboard

Support for fromBranch filter patterns

Open mwisner opened this issue 4 years ago • 4 comments

It looks like fromBranch is required to be a specific branch name. I'm wondering if it possible to use filter patterns similar to what GH actions support? https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet

name: Sync
on:
  push:
    branches:
      - release/*

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/[email protected]
        with:
          GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
          FROM_BRANCH: "release/*"
          TO_BRANCH: "develop"

mwisner avatar Sep 02 '20 11:09 mwisner

Hmm... I could see also lining up with a previous request to sync multiple branches as that ability would need to be added in order to handle wildcard filter patterns. I'm not sure if I'll have time soon to look into this, but if you wanted to make a PR for this, I'd be happy to review.

TreTuna avatar Sep 15 '20 16:09 TreTuna

@TreTuna @mwisner you can achieve it like that:

      - name: "get branch name"
        run: |
          echo "BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD)"  >> $GITHUB_ENV

      - name: Opening pull request
        uses: tretuna/[email protected]
        with:
          GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
          FROM_BRANCH: ${{env.BRANCH_NAME}}
          TO_BRANCH: "master"

katyapavlenko avatar Nov 18 '20 14:11 katyapavlenko

I'm going to keep multiple branches (in and out) on reserve for v2, which I'm going to try and get done in the next few months.

TreTuna avatar Oct 12 '21 20:10 TreTuna

Have you had any progress with v2? This would certainly fill our requirements if it was available!

martindanielsson avatar Apr 06 '22 06:04 martindanielsson