Scheduled job on specific branches

Hi,
it is my understanding from this that we currently can’t set a scheduled event on a specific branch.
something like:

name: My Workflow Job

on:
  schedule:
    - cron:  '0 5 * * *'
    - branches:
        - release-0.42

jobs:
  build:
...

am I correct to assume this?
if so, is there a workaround to this?
if not, is it planned on future gitActions versions?

Yes, the workflow must be on the default branch to work. If you want to use code from another branch, you can still do that by passing the branch name to the checkout action:

- uses: actions/checkout@v2
  with:
    ref: release-0.42
1 Like