Skip to content

Checkout ref (branch) ignored for cron schedule trigger #1764

Open
@theoturner

Description

@theoturner

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions