checkout
checkout copied to clipboard
Checkout ref (branch) ignored for cron schedule trigger
If an on: schedule: cron
is used, the checkout action will always pull the default branch. Minimal example:
name: Checkout non default branch
on:
schedule:
- cron: "0 * * * *"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out repo
uses: actions/checkout@v4
with:
ref: non_default_branch
From action runs we can see the default branch is used, ignoring the ref
.
The workflow_dispatch
and on: push
work as expected with the specified branch used.