Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for fromBranch filter patterns #40

Open
mwisner opened this issue Sep 2, 2020 · 4 comments
Open

Support for fromBranch filter patterns #40

mwisner opened this issue Sep 2, 2020 · 4 comments

Comments

@mwisner
Copy link

mwisner commented Sep 2, 2020

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/sync-branches@1.2.0
        with:
          GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
          FROM_BRANCH: "release/*"
          TO_BRANCH: "develop"
@TreTuna
Copy link
Owner

TreTuna commented Sep 15, 2020

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.

@katyapavlenko
Copy link

@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/sync-branches@1.2.0
        with:
          GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
          FROM_BRANCH: ${{env.BRANCH_NAME}}
          TO_BRANCH: "master"

@TreTuna
Copy link
Owner

TreTuna commented Oct 12, 2021

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.

@martindanielsson
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants