sync-branches
sync-branches copied to clipboard
Support for fromBranch filter patterns
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"
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 @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"
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.
Have you had any progress with v2? This would certainly fill our requirements if it was available!