Is it possible to only sync on a push to the default branch? #225
-
In our workflow we use release branches, so we can work concurrently in branches So when From what I found it is not possible from github itself, but perhaps this can be tested within the repo-file-sync-action itself? name: Sync interproject files
on:
push:
branches:
- release/*
workflow_dispatch:
jobs:
sync:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: BetaHuhn/repo-file-sync-action@v1
with:
GH_PAT: ${{ secrets.REPO_SYNC_PERSONAL_ACCESS_TOKEN }}
ASSIGNEES: boudewijn-zicht |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
During the action execution you have access to the default branch under name: Sync interproject files
on:
push:
branches:
- release/*
workflow_dispatch:
jobs:
sync:
if: github.ref == format('refs/heads/{0}', github.event.repository.default_branch)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: BetaHuhn/repo-file-sync-action@v1
with:
GH_PAT: ${{ secrets.REPO_SYNC_PERSONAL_ACCESS_TOKEN }}
ASSIGNEES: boudewijn-zicht See related StackOverflow thread. Hope this helps! |
Beta Was this translation helpful? Give feedback.
During the action execution you have access to the default branch under
github.event.repository.default_branch
. You could add a check so the sync job only gets executed if the ref matches that value:See related StackOverflow thread.
Hope this helps!