checkout icon indicating copy to clipboard operation
checkout copied to clipboard

Checkout ref (branch) ignored for cron schedule trigger

Open theoturner opened this issue 8 months ago • 0 comments

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.

theoturner avatar Jun 05 '24 09:06 theoturner